I've been searching the internet for the last 2 hours and can't seem to find a solution to the following problem.
I just installed Xen in a fresh Xubuntu 13.04 and in order to setup the networking, I had to remove network_manager. So, all network configuration is done through /etc/network/interfaces. At least, that's what should happen. However, it seems what I put in there is just being ignored: my xenbr0 interface doesn't get an IPv4 address assigned, there's no default gateway and no nameserver is setup.
Here's what's in the /etc/network/interfaces file:
auto lo
iface lo inet loopback
# There are no IP configurations for eth0, it’s all defined under xenbr0:
#auto eth0
# Static configuration
auto xenbr0
iface xenbr0 inet static
bridge_ports eth0
address 192.168.1.200 # the IP address of the Ethernet port
broadcast 192.168.1.255
netmask 255.255.255.0
gateway 192.168.1.1 # the address of the router
bridge_stp off # disable Spanning Tree Protocol - optional
bridge_waitport 0 # no delay before a port becomes available - optional, comment out if this gives you troubles
bridge_fd 0 # no forwarding delay - optional
dns-nameservers 192.168.1.1
In order to fix my network connection, I run a small "fix" script:
#!/bin/bash
ifconfig xenbr0 192.168.1.200 netmask 255.255.255.0 up
route add default gw 192.168.1.1 xenbr0
I would like to fix at the core though. Right now booting takes at least 1 minute extra, because the system waits for a working network connection.
Edit: I also had to add the following to /etc/resolvconf/resolv.conf.d/base and run sudo resolvconf -u
:
nameserver 192.168.1.1
Without this I can only ping IP addresses, no DNS requests get passed through. This is actually what convinced me that the interfaces file is completely ignored.
Edit 2: Doing either sudo restart networking
or sudo /etc/init.d/networking restart
doesn't do anything.
Edit 3: Some extra info. Here is what ifconfig
output should look like (working network/internet connection):
eth0 Link encap:Ethernet HWaddr 00:1c:c0:77:09:9d
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3346 errors:0 dropped:0 overruns:0 frame:0
TX packets:2903 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2931429 (2.9 MB) TX bytes:661616 (661.6 KB)
Interrupt:20 Memory:e3200000-e3220000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1720 (1.7 KB) TX bytes:1720 (1.7 KB)
xenbr0 Link encap:Ethernet HWaddr 00:1c:c0:77:09:9d
inet addr:192.168.1.200 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21c:c0ff:fe77:99d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3329 errors:0 dropped:0 overruns:0 frame:0
TX packets:2875 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2870029 (2.8 MB) TX bytes:647394 (647.3 KB)
Here is what it looks like right after boot. The only thing missing is the xenbr0 IPv4 address (and the routing/DNS data, but you can't see that in ifconfig's output):
eth0 Link encap:Ethernet HWaddr 00:1c:c0:77:09:9d
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0 B) TX bytes:0 (0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0 B) TX bytes:0 (0 B)
xenbr0 Link encap:Ethernet HWaddr 00:1c:c0:77:09:9d
inet6 addr: fe80::21c:c0ff:fe77:99d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0 B) TX bytes:0 (0 B)