How to properly set-up multiple NICs?

Olaf Greve o.greve at axis.nl
Wed Oct 12 07:10:29 PDT 2005


Hi,

Tnx for the reply!

> I don't think you've missed anything. 

Good! That's what I also thought, but I just wanted to be sure. :)

> In /etc/rc.conf you can add something like:
> ifconfig_rl0="inet 192.168.17.1 netmask 0xffffff00"
> ifconfig_lo0_alias0="inet 172.17.0.1 netmask 0xffffffff"
> ifconfig_vge0="dhcp"
> ...to give you the general idea. It's enough to bring
> the NICs up and running, but then consider DNS
> and other issues that provide for a networking environment.

Yes, the main entry, i.e., the one for the outside world is set-up like 
this:
ifconfig_rl0="inet 123.45.67.89  netmask 255.255.255.0"
defaultrouter="123.45.67.1"
hostname="abcdef.nl"

My other two NICs are identified as re0 and sk0. When setting up one of 
them, say re0, for the local network I guess I only have to add an entry 
to /etc/rc.conf like:

ifconfig_re0="inet 192.168.1.1  netmask 255.255.255.254"

(note: the above gives a very restrictive netmask, as I'll only need the 
addresses 192.168.1.1 and 192.168.1.2).

Would the above be correct, or should there also be an additional 
defaultrouter entry, next to the one for the outside traffic (e.g. 
defaultrouter="192.168.1.1")? This wouldn't really make sense to me, as 
I guess that one would then become 'the' defaultrouter for all traffic 
(be it local or outside world)...

Cheers!
Olafo


More information about the freebsd-questions mailing list