Port-xen archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: default route on other subnet



On 28.06.2011 21:14, Pierre-Philipp Braun wrote:
> # arp -a
> ? (DOM0_IP) at c8:0a:a9:03:36 on xennet0 permanent
> 
> # netstat -r -f inet
> Routing tables
> 
> Internet:
> Destination        Gateway            Flags    Refs      Use    Mtu
> Interface
> DOM0_IP     c8:0a:a9:03:36:00  UHLS        0        1      -  xennet0
> GUEST_IP/32  link#1             UC          0        0      -  xennet0
> localhost          localhost          UH          0      140  33648  lo0
> 
> In the first case 78:65:6e:6e:65:74 doesn't correspond to anything. 

It's 'xennet0' converted into hex.

What you are trying to achieve is kind of difficult. With a xennet0
configured as a /32 in domU (and without a default route), you are
basically setting up your domain as being "non routable". It can only
communicate with itself (excluding certain circumstances, but that's not
the point here).

Routing packets (like the ones with your ping) will only work when the
domain is capable of figuring out a route at a L2 level, e.g. AF_LINK
for routing socket. But the NetBSD domain will refuse to add addresses
in its ARP table that do not belong to its networks, and as it has none...

For routing dom0 <> domU, without proxy ARP, I'd suggest to set an IP
for vif, and a small iproute2 command:

# dom0
ifconfig vifN.0 192.168.5.1/32 up
ip route add 192.168.5.2 via 192.168.5.1 dev vifN.0

# domU
ifconfig xennet0 192.168.5.2/30

Ultimately, the domU doesn't care about the fe:ff:ff:... MAC address, so
long it's found in its own subnet.

# netstat -rn
Routing tables
Internet:
Destination    Gateway            Flags    Refs      Use    Mtu  Interface
192.168.5.0/30 link#1             UC          1        0      -  xennet0
192.168.5.2    fe:ff:ff:ff:ff:ff  UHLc        0        2      -  xennet0

Yup, that involves the creation of an additional IP in dom0 to perform
the routing.

There's probably a better way to do that, but I can't see how it would
be possible to create a link for an interface that the domU is not
supposed to address. Making it work that way with route(8) is beyond my
current knowledge.

-- 
Jean-Yves Migeon
jeanyves.migeon%free.fr@localhost


Home | Main Index | Thread Index | Old Index