Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to Xen and peth works???
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
nakun
n00b
n00b


Joined: 05 Jun 2007
Posts: 17

PostPosted: Sat Feb 16, 2008 12:54 pm    Post subject: How to Xen and peth works??? Reply with quote

Hi, I trying to give an IP adress by DHCP to Dom0 with Xen ( actually Xen 3.2.0) and I have one doubt.
I have to make a "dhcpcd eth0" or "dhcpcd peth0" ???
When I try to make "dhcpcd peth0" always get "time out", but when I make "dhcpcd eth0" I get an IP adress and all works fine, but I read that Dom0 uses peth0 as interface because of that it brings down eth0 during boot process.
Anyone can explained my how it supoused to work??
Here It is my ifconfig:

eth0 Link encap:Ethernet HWaddr 00:50:8D:B2:18:6D
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:23712 errors:0 dropped:0 overruns:0 frame:0
TX packets:11112 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:26811047 (25.5 Mb) TX bytes:1000563 (977.1 Kb)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:412 errors:0 dropped:0 overruns:0 frame:0
TX packets:412 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:22080 (21.5 Kb) TX bytes:22080 (21.5 Kb)

peth0 Link encap:Ethernet HWaddr 00:50:8D:B2:18:6D
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:25276 errors:0 dropped:0 overruns:0 frame:0
TX packets:14983 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:27440931 (26.1 Mb) TX bytes:1843459 (1.7 Mb)
Interrupt:23 Base address:0xc000

xenbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
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.0 b) TX bytes:0 (0.0 b)

if you can si peth0 copy the Mac adress well.
Here it is my dmesg:

peth1: link up.
eth1: port 1(peth1) entering learning state
eth1: topology change detected, propagating
eth1: port 1(peth1) entering forwarding state

and here is my brctl show

bridge name bridge id STP enabled interfaces
eth0 8000.00508db2186d no peth0
xenbr0 8000.000000000000 no
Back to top
View user's profile Send private message
flash49
Apprentice
Apprentice


Joined: 12 Feb 2005
Posts: 233

PostPosted: Sat Feb 16, 2008 8:38 pm    Post subject: Reply with quote

The xen network script is really f**t up. First it tries to copy your setting from the physical eth0(or whatever interface has the default route) and renames it to peth0. It then creates a bridge named eth0 and copies the ip address settings to this bridge.

Quote:
and here is my brctl show

bridge name bridge id STP enabled interfaces
eth0 8000.00508db2186d no peth0
xenbr0 8000.000000000000 no

As you can see eth0 is a bridge and no longer an interface. Normally the bridge should be named xenbr0, this bridge is created but does not get the physical interface. :evil:

The best solution to this problem is disabling the network script in "xend-config.sxp" and creating the bridge with gentoo:
/etc/conf.d/net
Code:
# To add ports to bridge br0
config_eth0=( "null" )

bridge_xenbr0="eth0"

config_xenbr0=( "192.168.178.7/24" )
routes_xenbr0=(
       "default via 192.168.178.1"               # IPv4 default route
)

/etc/xen/
Code:
(network-script '/bin/true')

(vif-script vif-bridge)
(The vif script stays the same)
Back to top
View user's profile Send private message
nakun
n00b
n00b


Joined: 05 Jun 2007
Posts: 17

PostPosted: Sun Feb 17, 2008 3:08 am    Post subject: Reply with quote

thanks for your answer, now I understand a little more how Xen works.
Finally the answer was more easy.
I didn't have a net.eth0 link in /etc/init.d. when I created it, all works well, Dom0 get DHCP IP adress through xenbr0 and all DomUs get their IP.
Now ifconfig show me this:

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:899 errors:0 dropped:0 overruns:0 frame:0
TX packets:899 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:256711 (250.6 Kb) TX bytes:256711 (250.6 Kb)

peth0 Link encap:Ethernet HWaddr 00:50:8D:B2:18:6D
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1763 errors:0 dropped:0 overruns:0 frame:0
TX packets:1037 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:938894 (916.8 Kb) TX bytes:246658 (240.8 Kb)
Interrupt:23 Base address:0xc000

xenbr0 Link encap:Ethernet HWaddr 00:50:8D:B2:18:6D
inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1762 errors:0 dropped:0 overruns:0 frame:0
TX packets:1019 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:913908 (892.4 Kb) TX bytes:244682 (238.9 Kb)

And brtl show

bridge name bridge id STP enabled interfaces
xenbr0 8000.00508db2186d no peth0


PD: I'm using Xen 3.2
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum