# xen init scripts and networking

## rsala

I was having trouble getting network bridging to work between my dom0 and my domU last week.  Then Sat. there was an update to xen,

```
app-emulation/xen-3.0.0-r2
```

and things improved somewhat.  It still doesn't seem quite correct but now with a little tweaking I can get xend to set up the networking to support bridging.

At system startup xend seems to start up ok, but ifconfig shows only:

```
 # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0B:DB:CF:95:10  

          inet addr:192.168.100.105  Bcast:192.168.100.255  Mask:255.255.255.0

          inet6 addr: fe80::20b:dbff:fecf:9510/64 Scope:Link

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:691 errors:0 dropped:0 overruns:0 frame:0

          TX packets:842 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:386435 (377.3 Kb)  TX bytes:105312 (102.8 Kb)

          Base address:0xdf40 Memory:feae0000-feb00000 

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:16436  Metric:1

          RX packets:212 errors:0 dropped:0 overruns:0 frame:0

          TX packets:212 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:22048 (21.5 Kb)  TX bytes:22048 (21.5 Kb)

xenbr0    Link encap:Ethernet  HWaddr 00:00:00:00:00:00  

          inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 b)  TX bytes:378 (378.0 b)

```

and brctl shows only this:

```
 # brctl show  

bridge name     bridge id               STP enabled     interfaces

xenbr0          8000.000000000000       no              

```

and xm list:

```
# xm list

Name                              ID Mem(MiB) VCPUs State  Time(s)

Domain-0                           0      128     2 r-----    85.8

```

If I were to try to start my domU it would come up without bridging. So ...

```
# /etc/init.d/xend restart

 * Stopping Xen control daemon ...                                                                             [ ok ]

 * Starting Xen control daemon ...                                                                             [ !! ]

```

Now xend fails to start back up, but ...

```
 ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0B:DB:CF:95:10  

          inet addr:192.168.100.105  Bcast:192.168.100.255  Mask:255.255.255.0

          inet6 addr: fe80::20b:dbff:fecf:9510/64 Scope:Link

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:285 errors:0 dropped:0 overruns:0 frame:0

          TX packets:182 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:130491 (127.4 Kb)  TX bytes:27536 (26.8 Kb)

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:16436  Metric:1

          RX packets:263 errors:0 dropped:0 overruns:0 frame:0

          TX packets:263 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:27352 (26.7 Kb)  TX bytes:27352 (26.7 Kb)

peth0     Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF  

          inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link

          UP BROADCAST RUNNING NOARP MULTICAST  MTU:1500  Metric:1

          RX packets:1279 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1324 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:608516 (594.2 Kb)  TX bytes:161793 (158.0 Kb)

          Base address:0xdf40 Memory:feae0000-feb00000 

vif0.0    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF  

          inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:182 errors:0 dropped:0 overruns:0 frame:0

          TX packets:287 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:27536 (26.8 Kb)  TX bytes:130659 (127.5 Kb)

xenbr0    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF  

          inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:95 errors:0 dropped:0 overruns:0 frame:0

          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:4912 (4.7 Kb)  TX bytes:378 (378.0 b)

```

...now the networking looks correct.  Now ...

```
 # /etc/init.d/xend start

 * Starting Xen control daemon ...                                                                             [ ok ]

```

... and I can start my domU with network bridging support.  Can anyone help me with what's going on here?

----------

## pjp

Moved from Portage & Programming

----------

## Simba

I had the same problem few weeks ago, but it works now fine. I use also now 2

bridges, one for normal networking to internet, and another bridge for private 

addresses.  

But unfortunately I forget what I did to resolve my problem  :Smile:  maybe I just 

tried difference combinations of configs or kernel.

Maybe you can try manualy to execute "/etc/xen/scripts/network-brigde start"

before you start the xend daemon, and check if all virtual interfaces

are created. 

you can try also to set RC_NET_STRICT_CHECKING="lo"

in /etc/conf.d/rc

I had also another network problem before, when I start xend, all virtual interfaces 

were created but they don't have network connection anymore, and then I found out 

the problem was with mii-tool I used to set inteface's speed and autonegotiation

manualy during the boot. If I don't use it or if I use ethtool instead of mii-tool, 

the networking works perfectly.

Simba

----------

## rawlink

I was having this exact same problem.

All my issues where fixed by setting RC_NET_STRICT_CHECKING="lo" in /etc/conf.d/rc .

This is also mentioned somewhere in the xen-users mailing list.

----------

## rsala

Thanks!  It worked for me too.  I had read thru the /etc/conf.d/rc file after Simba's post, but "lo" didn't seem like what I wanted.

Does anyone know why it works this way?  I would have expected that I would need my eth0 up before I could configure it for bridging.

----------

