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.
0 1 2 3 4 5 6 7 8 9 |
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
0 1 2 3 4 5 6 7 8 |
/etc/network/interfaces auto eth0 iface eth0 inet static address 192.168.122.97/24 gateway 192.168.122.1 hostname oldtacacs |
As the GNS3 appliance is only 3.7 the subnet mask needs its own line.
0 1 2 3 4 5 6 7 8 9 |
/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 oldtacacs |
Full Commands
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
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
0 1 2 |
sudo ifconfig eth0 192.168.122.97 netmask 255.255.255.0 |