Iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE Iptables -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT Iptables -A FORWARD -i $EXTIF -o $INTIF -j ACCEPT # clear existing iptable rules, set a default policy
Setting NAT can be do with the following code You can set you host machine (and unset it) for a temporary connection If you want that the machine are not normally connected to the wide world I we do so, all systems can reach the web and you may surf or download files within your virtual machine. The simplest way should be to insert the interface used for the connection to the internet and using the dhcp server provided by the router (if you are attached to the internet via a DSL router). In order ot get this working we must configure the main system so that it do NAT.
Ne able to update a guest system or download anythings. With the above scenario we don't have access to the wide world and will not If you want to use zeroConf rendez-vous/Bonjour for automatic setting of the IP address for the guests you shout use an addres in the range 169.254.0.0/16 for the host eg 169.254.0.1.Ĭonnecting the internal network to the world. You may also assign the address via DHCP, in this case the dhcpd daemon must work on the host machine.Ī simple configuration shall look as follow: The content of this file can be the same as for the nf file on your computer. You must also edit the file /etc/nf in order to be able to resolve network names such as or local names. Ip route add default via 10.1.1.1 dev eth0 On linux the commands which are to be called manually are: You may use the tools provided by the guest system in order to configure the device used for the network connection or set the ip address manually or via a script. Now we will be able to start the virtual machines 1 to n, the virtual machineĪre to be attached to tap1, tap2. # create the taps and insert them into the bridge If we plan to use more as one virtual machine we can add further tap devices to the bridge. With these settings we will not have an access to the external world from the virtual machine. The IP adress should not conflict with the main IP address of your PC which will probably been within the range 192.168.0.0/16. With this code you will be able to contact the virtual machine attached to the Host Interface tap1 from the host and the host from the virtual machine. # set PATH for the case we are called via sudo or su root The virtual machine may be fully integrated into the network and you may have access between all virtual machine and the host if you do a little bit more.Ī bridge can contain only one physical/virtual device.