Two NICs with one IP address each on the same subnet

Lowell Gilbert freebsd-questions-local at be-well.ilk.org
Wed Nov 10 10:30:56 PST 2004


Sean Peisert <speisert at yahoo.com> writes:

> I have a FreeBSD 5.x box with two NICs that I'd like
> to set up on the same subnet.  The purpose is to run
> separate services on each NIC.  I have the box set up
> with my rc.conf containing the following lines:
> 
> defaultrouter="..."
> hostname="..."
> ifconfig_xl0="inet ...  netmask 255.255.255.224"
> ifconfig_sk0="inet ...  netmask 255.255.255.224 mtu
> 9000"
> 
> The router and IP addresses are all on the same
> subnet, as I previously mentioned.  Unfortunately, the
> first IP address seems not to work (I can ssh to the
> second, but not the first).  Is there something
> special I need to do to the routing to get this to
> work?  Anything to the kernel?  

First of all, there's no reason to do this on a separate NIC.  Just
use one and put an alias on it for the second address.  And secondly,
it should be obvious that you can't really have two different routes
to that subnet.  [so use an all-ones mask with one of the addresses]

-- 
Lowell Gilbert, embedded/networking software engineer, Boston area
		http://be-well.ilk.org:8088/~lowell/


More information about the freebsd-questions mailing list