xen networking: routing

Hi,

ich versuche gerade routing als networking Strategie unter Xen zu verstehen. Also, ich habe in der xend-config.sxp auf routing umgestellt:

/etc/xen/xend-config.sxp
Code:
...
(network-script 'network-route netdev=eth1')
(vif-script 'vif-route netdev=eth1')
...

Dann musste ich erstmal herausfinden, dass ich die domain cfg files in der Netzwerkkonfiguration mit einem "if=..." bestücken muss:

/etc/xen/backup.cfg
Code:
vif = [ 'ip=10.0.0.3' ]

Soweit so gut, die Domain ist erreichbar. Nur verstehe ich nicht, wie das funktionier. Da das alles mit Linux Boardmitteln passiert, findet sich hier bestimmt jemand der's mit erklären kann.

xm list
Code:
xenhost:~# xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  3757     4     r-----     10.8
backup                                       1   256     1     -b----      1.8
xenhost:~#

ifconfig -a in Domain0:
Code:
xenhost:~# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:22:15:9f:1e:10  
          BROADCAST 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.0 B)  TX bytes:0 (0.0 B)
          Interrupt:17 

eth1      Link encap:Ethernet  HWaddr 00:22:15:9f:2e:f2  
          inet addr:10.0.0.2  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::222:15ff:fe9f:2ef2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1149 errors:0 dropped:0 overruns:0 frame:0
          TX packets:763 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:115234 (112.5 KiB)  TX bytes:105598 (103.1 KiB)
          Interrupt:18 

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: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)

vif1.0    Link encap:Ethernet  HWaddr fe:ff:ff:ff:ff:ff  
          inet addr:10.0.0.2  Bcast:10.255.255.255  Mask:255.255.255.255
          inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:36 errors:0 dropped:0 overruns:0 frame:0
          TX packets:39 errors:0 dropped:2 overruns:0 carrier:0
          collisions:0 txqueuelen:32 
          RX bytes:2744 (2.6 KiB)  TX bytes:3506 (3.4 KiB)

xenhost:~#

Okay, das physische Device ist eth0 - dadrüber kommt dom0 raus. Das eth0 in domU (backup) ist "verbunden" mit vif1.0.

Warum hat vif1.0 die Adresse 10.0.0.2/32? Eigentlich ja dieselbe IP wie eth0, aber eben andere Maske. Und ist das normal, dass die Broadcast Adresse 10.255.255.255 ist? Wäre sie das nicht bei ner /8 Maske?

Dann habe ich noch iptables Einträge, die ich nicht verstehe:
Code:
xenhost:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  10.0.0.3             anywhere            PHYSDEV match --physdev-in vif1.0 
ACCEPT     udp  --  anywhere             anywhere            PHYSDEV match --physdev-in vif1.0 udp spt:bootpc dpt:bootps 

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
xenhost:~#

Das einzige was ich glaube ich verstehe ich die Routing Tabelle in dom0:
Code:
xenhost:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.3        0.0.0.0         255.255.255.255 UH    0      0        0 vif1.0
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth1
0.0.0.0         10.0.0.1        0.0.0.0         UG    0      0        0 eth1
xenhost:~#
Also alles was an 10.0.0.3 soll muss durch vif1.0 - klar.

Jetzt frag ich mich auch noch wie der ARP request überhaupt beantwortet werden kann wenn ich von einem anderen Host aus die 10.0.0.3 (backup domain) pinge. Eth0 in dom0 wirds das ja wohl nicht tun. Und ARP Requests sollten auch nicht geroutet werden.

Evtl kann jemand da etwas Licht ins Dunkel bringen.

cu
serow
 
Zurück
Oben