Create a virtual network for communication of all LTSP client, server and dhcp server
Created by: d78ui98
When you test with a virtual client and a virtual DHCP server (and virtual LTSP server of course), and all three of them are on the same computer/laptop, I think that you may need to create a virtual network as well, and connect all three of them to this virtual network, so that they can communicate with each-other.
If you bridge all three of them to an ethernet (cable) network interface, this can work only if this interface is connected to a switch/hub (or to another computer) through a cable. If no cable is connected, then the status of the network interface will be NO-CARRIER (not connected), and the same status will be inherited to the virtual interfaces that are bridged over it (ltsp-client, dhcp-server, ltsp-server), and so all three of them will be disconnected from each-other.
However it is not very practical to connect the machine to a hub just to test the ltsp-client and ltsp-server, so it may be better to create and use a virtual network in this case.
Maybe you can create a script test.sh start
which creates the virtual interface and modifies settings.sh by setting which interface to use for bridging to LAN. Then you can start up the dhcp-server, ltsp-server, ltsp-client and perform the testing steps (make login on the client, etc.)
When you are done, you call test.sh stop
which shuts down the virtual machines, deletes the virtual interface, then modifies back settings.sh
.
This shows that the interface (on the laptop) that will be used for bridging to LAN cannot be auto-detected, in general. In some special cases you may be able to auto-detect it, but not always. For example, in the mode non-standalone, you may look for the default route, find the interface, and that is the one that you should use for bridging to LAN. But this assumes that the laptop is already connected to the LAN and has received an IP from the DHCP server, and it is not connected to any wifi networks). So, it may not always work.
In standalone mode however, you can use this method to get the WAN interface and it will always work correctly