Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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)
share|improve this question
    
Check init.d and the other start-up scripts for the missing network interface initialization info. Let us know what you found. –  RGS Jun 1 '13 at 13:59
    
When you type /etc/init.d/networking restart do you get the configuration of the interfaces file? –  ortang Jun 1 '13 at 14:37
    
Try with auto eth0 and iface eth0 inet manual. –  Eric Carvalho Jun 1 '13 at 14:44
    
When you run ifconfig right after boot, is there any interface up? –  Eric Carvalho Jun 1 '13 at 14:46
    
@ortang: No, I tried that as well, nothing happens. –  Darhuuk Jun 1 '13 at 16:14
show 2 more comments

3 Answers

You have:

address         192.168.1.200 # the IP address of the Ethernet port

and report that this is the line that isn't working. Are you aware, from interfaces(5), that:

   Lines starting with `#' are ignored. Note  that  end-of-line  comments
   are NOT supported, comments must be on a line of their own.

Did you add the end-of-line comments for the question, or do you actually have them in your /etc/network/intefaces file? If so, try removing them.

share|improve this answer
    
+1, well-spotted, if true. –  Alaa Jun 6 '13 at 11:17
    
@Darhuuk Robie is right. I think this is what's wrong in your interfaces file. –  Eric Carvalho Jun 6 '13 at 11:22
    
Ah, nice find. Those comments where added by the Xen install and are indeed at the end of the line. Uncommenting auto eth0 seems to have fixed my problem, even though the comments are still there. –  Darhuuk Jun 6 '13 at 14:44
add comment
up vote 1 down vote accepted

I managed to fix my problem by changing 2 files. First of all, as suggested by Eric Carvalho, I uncommented auto eth0 in /etc/networking/interfaces. (Note that this is quite odd, several tutorials online seem to suggest this shouldn't be required for Xen.)

That by itself did not fix the slow boot though. It seems that on startup it still took a few seconds before the interfaces came up and in the meantime Ubuntu was already stuck in a 60 seconds idle wait. This I fixed by modifying the delay time in /etc/init/failsafe.conf from 60 seconds to 1 second. (I found out about this file through Google, no idea which one it was exactly.)

share|improve this answer
add comment

Perhaps, despite having removed the network-manager package, you still have the file /etc/NetworkManager/NetworkManager.conf containing

[ifupdown]
managed=true

which causes ifup not automatically to bring up interfaces.

If this is the cause of the problem then I suggest either dpkg --purge network-manager or setting managed=false.

I filed a bug report about this: https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1187693

share|improve this answer
    
I'll check this tonight when I get home. However, the interfaces are up after booting, just not correctly configured. Manually running sudo restart networking also doesn't fix the problem. –  Darhuuk Jun 5 '13 at 9:34
    
@jdthood, don't you mean to say that ifupdown might actuall be already set to managed=false, and that he needs to set it to true in order for it to start using the settings in /etc/network/interfaces? –  Alaa Jun 5 '13 at 10:16
    
@Alaa, no I didn't mean what you suggest. In Ubuntu, ifup actually looks in /etc/NetworkManager/NetworkManager.conf and refrains from auto-upping interfaces if NM is configured to configure those interfaces my means of "[ifupdown] managed=true". –  jdthood Jun 5 '13 at 20:58
    
I just tried with both managed true & false (this was what it was set to), neither of those worked. Then did a dpkg --purge, which didn't help either, my /etc/network/interfaces still isn't taken into account. –  Darhuuk Jun 5 '13 at 21:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.