Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 May 2008 21:29:09 +0200
From:      Andrea Venturoli <ml@netfence.it>
To:        freebsd-net@freebsd.org
Subject:   Routing problem with aliases
Message-ID:  <48220305.7010605@netfence.it>

next in thread | raw e-mail | index | archive | help
Hello.
A box of mine has an interface configured with two IPs on two different 
nets:

# ifconfig
xl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
         options=9<RXCSUM,VLAN_MTU>
         inet 192.168.2.2 netmask 0xffffff00 broadcast 192.168.2.255
         inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
         ether 00:50:da:77:5f:79
         media: Ethernet autoselect (100baseTX <full-duplex>)
         status: active

Then I have two gateways: 192.168.2.1 and 192.168.0.6.

"ping 192.168.2.1" works correctly (source address 192.168.2.2 is used)
"ping 192.168.0.6" also does (source address 192.168.0.2 is used)

Setting 192.168.2.1 as my default gateway allows me to ping any host on 
the Internet (again source address 192.168.2.2 is used).

However, if I set 192.168.0.6 as the default router, I can't reach the 
Internet, since it uses source address 192.168.2.2 and the next router 
won't obviously like it.

Is this normal behaviour? Anything to set or check? Any other hint?

Perhaps I should mention that I also have some carp devices on that 
interface, but I'm not sure whether it matters.

  bye & Thanks
	av.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48220305.7010605>