In my GNS3 lab for my TACACS Netmiko project I had an issue with my tacGUI boxes not retaining their DHCP addresses and not accepting a static IP address.
https://www.gns3.com/community/featured/tacacs-appliance-with-gui
The underlying OS on these VMs is Apline Linux 3.7.
tacacs:~# cat /etc/*release*
3.7.0
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.7.0
PRETTY_NAME="Alpine Linux v3.7"
HOME_URL="http://alpinelinux.org"
BUG_REPORT_URL="http://bugs.alpinelinux.org"
The documentation states that there are two methods for configuring the static IP based on the version. Version 3.13 requires slash notation on the end of the IP address to represent the subnet mask.
https://wiki.alpinelinux.org/wiki/Configure_Networking#IPv4_Static_Address_Configuration
/etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.122.97/24
gateway 192.168.122.1
hostname oldtacacsAs the GNS3 appliance is only 3.7 the subnet mask needs its own line.
/etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.122.97
netmask 255.255.255.0
gateway 192.168.122.1
hostname oldtacacsFull Commands
tacacs:~# sudo vi /etc/network/interfaces
auto lo
iface lo inet loopback
#auto eth0
#iface eth0 inet dhcp
# hostname tacacs
auto eth0
iface eth0 inet static
address 192.168.122.97
netmask 255.255.255.0
gateway 192.168.122.1
hostname oldtacacs
tacacs:~# /etc/init.d/networking restart
Another thing that can be done is to temporarily change the IP. This works until reboot
sudo ifconfig eth0 192.168.122.97 netmask 255.255.255.0
