[OT]two networks, one nic

Jerry McAllister jerrymc at msu.edu
Tue Nov 14 15:44:47 UTC 2006


On Mon, Nov 13, 2006 at 09:52:32PM -0800, jekillen wrote:

> Hello FreeBSD users,
> I have been operating under the assumption that
> the same network interface card cannot handle two
> different networks. But then I seem to have seen
> an example in one of the OReill? books on networking
> that had one interface with one assigned inet address
> and also aliased with another address that could only
> be on another network. If I understood that right, it
> seems to imply that I can use one Network interface
> card for at least two different networks, like so;
> 192.168.1.<somthing> and
> alias 172.0.0.<something>
> or;
> 192.168.1.<something>
> alias 192.168.2.<something>

Alias works fine.   You have one primary address and many aliases.

Put the ifconfig alias variable setting in your /etc/rc.conf or
possibly rc.conf.local file.  The syntax is:

# Main (first) if config:
 ifconfig_xl0="inet 192.168.1.something  netmask 255.248.0.0"

The netmask needs to be whatever is correct for your situation.

# All subsequent ifconfig variable setting are aliases as follows:
 ifconfig_xl0_alias0="192.168.2.something netmask 255.255.255.255"

The 'xl0' is the NIC device.  Each alias needs to have a unique
number on it and then must be sequential starting with '0' - so the
next alias would be 'alias1', etc.  The netmask for aliases
should be 255.255.255.255

> If this is possible is it accomplished via a special routing?

Nope, standard stuff.

> My concern is that I have a laptop with one network
> interface, built in,  but would like to access it both at
> a public static address and a private network address.
> Is this possible?

Well, in this case you are really talking about two physical networks.
So, for that you need two separate NICs.   But, your NIC can respond
to more than one network address on any given physical network by
using aliases as mentioned above.

////jerry

> 
> Thanks in advance for time and attention;
> Jeff K
> 
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
> 


More information about the freebsd-questions mailing list