Networking UML under Debian
I recently needed to setup the networking on a Debian box with three network cards on three different networks, each assigned three IP addresses – two of which would be assigned to taps for UML hosts.
It was actually a little more complex that I was expecting. Of the few configuration examples I’ve seen on the web, none of them adequately covered the mixing bridges and tunnels in “/etc/network/interfaces”.
Weirdly, even though I’ve been using it for a few years, it’s only now that I’m beginning to grok ifupdown (the Debian way of configuring network interfaces). It’s a powerful, simple, and extensible enough to support fairly complex actions with simple, elegant, configurations. For example, ”uml_proxy_*” handles inserting static routes and ARP proxying.
The downside, sadly, is that it’s near impossible to provide any definitive documentation of “interfaces” – good luck finding documentation for ”uml_proxy_*”!
The following “/etc/network/interfaces” requires the extensions provided by resolvconf, uml-utilities, and bridge-utils to run correctly.
auto lo
iface lo inet loopback
auto umltap0_0 umltap0_1
auto umltap1_0 umltap1_1
auto umltap2_0 umltap2_1
iface umltap0_0 inet static
tunctl_user uml
address 192.0.2.30
netmask 255.255.255.240
iface umltap0_1 inet static
tunctl_user uml
address 192.0.2.26
netmask 255.255.255.240
iface umltap1_0 inet static
tunctl_user uml
address 10.140.1.3
netmask 255.255.255.0
iface umltap1_1 inet static
tunctl_user uml
address 10.140.1.4
netmask 255.255.255.0
iface umltap2_0 inet static
tunctl_user uml
address 10.51.1.143
netmask 255.255.255.0
iface umltap2_1 inet static
tunctl_user uml
address 10.51.1.144
netmask 255.255.255.0
auto br0 br1 br2
iface br0 inet static
pre-up ifconfig eth0 0.0.0.0 promisc up
address 192.0.2.27
netmask 255.255.255.240
network 192.0.2.16
broadcast 192.0.2.31
gateway 192.0.2.17
bridge_fd 0
bridge_hello 0
bridge_stp off
bridge_ports eth0 umltap0_0 umltap0_1
uml_proxy_arp 192.0.2.30 192.0.2.26
uml_proxy_ether br0
dns-search example.com
dns-nameservers 192.0.2.17
post-down ifconfig eth0 down
iface br1 inet static
pre-up ifconfig eth1 0.0.0.0 promisc up
address 10.140.1.2
netmask 255.255.255.0
network 10.140.1.0
broadcast 10.140.1.255
bridge_fd 0
bridge_hello 0
bridge_stp off
bridge_ports eth1 umltap1_0 umltap1_1
uml_proxy_arp 10.140.1.3 10.140.1.4
uml_proxy_ether br1
post-down ifconfig eth1 down
iface br2 inet static
pre-up ifconfig eth2 0.0.0.0 promisc up
address 10.51.1.142
netmask 255.255.255.240
bridge_fd 0
bridge_hello 0
bridge_stp off
bridge_ports eth2 umltap2_0 umltap2_1
uml_proxy_arp 10.51.1.143 10.51.1.144
uml_proxy_ether br2
up route add -net 10.51.0.0/16 gw 10.51.1.129 br2
post-down ifconfig eth2 down





