gns3-server
gns3-server copied to clipboard
docker : GNS3 replaces the file /etc/network/interfaces ?
Hi
I have a docker template which contains his own /etc/network/interfaces.
When we add this tempalte on the lab, GNS3 creates in this image a new file /etc/network/interfaces.
Is it a bug or a choose of GNS3 Team ?
That's a feature.
Normally Docker does the network setup for the containers, so Docker images don't need to do anything for setting up the network. In case of GNS3 the network setup is not done by Docker but by GNS3 by injecting a busybox binary. That uses the /etc/network/interfaces file. As this configuration file is normally not present in a Docker image, it is added by GNS3.
Thank you for the answer.
So, GNS3 can perhaps create the file /etc/network/interfaces only if it doesn't exist ?
I suppose that GNS3 can't know if the docker VM contains the file "/etc/network/interfaces" before to start it. If you add a option in the GNS3 to not create the file, GNS3 will not have a file to edit with the menu "Edit config"
Or do as dynamips/IOU ("initial startup config") : add an option to choose our own file to use
Or do as dynamips/IOU ("initial startup config") : add an option to choose our own file to use
This would be the simplest to implement I think.
Docker needs really an interface to customize the network interface :
-
If the docker VM starts with systemd, and the network interface starts eth0 with dhcp, then eth0 asks IP at boot by systemd. But in init.sh, GNS3server does also a "ifup -a -f" . Also eth0 asks twice an IP, then have 2 IP.
-
GNS3 adds "hostname Name" in "/etc/network/interfaces". This keyword is useful with udhcpd, but useless with dhclient (by default in Debian) (I haven't see any trames with "Name"). Luckily there is no error message, but we have a useless keyword to explain to our students ;-)
An other idea is :
- A "BEGIN" box text
- A "INTERFACE" box text for 1 interface based on a variable for the name of the interface and the name of the VM (and perhaps others variables)
- A "END" box text.
GNS3 creates the file "/etc/network/interfaces" with these texts ("INTERFACE" box text is called for each interface).
- With a check box to use instead the default "/etc/network/interfaces" of GNS3.
- And a check box to do the "ifup -a -f"
it's not sufficient : some network programs are started by scripts in /etc/network/if-up.d
, ... (example : wpasupplicant
)
An idea is to add also an option to choose our own archive file whose contains the files of the folder /etc/network
Be careful : the uncompress must manage symbolic links