Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Aug 1999 11:35:58 -0700 (PDT)
From:      "David E. Cross" <crossd@cs.rpi.edu>
To:        "SuSE Linux 6.1 user" <biscotti@mbox5.singnet.com.sg>
Cc:        freebsd-questions@FreeBSD.ORG, crossd@cs.rpi.edu
Subject:   Re: How do i setup network cards in freebsd 
Message-ID:  <199908240628.XAA04627@gilliam.users.flyingcroc.net>

next in thread | raw e-mail | index | archive | help
I will make the one assumption that you are not using DHCP for this...


You need to edit /etc/rc.conf.

First you need to tell the system which network interfaces to enable, this is
done with the variable 'network_interfaces'.  This is a space deliminated list
of all of the interfaces that you wish to configure.  On very recent systems
this variable can be set to "auto" to have the system try to config all the
interfaces by itself.  You likely do not have such a system, so you will need
the more manual way.  You need to collect a list of all the interfaces on your
machine.  I do this with the following command:

> # ifconfig -a
> xl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         inet 10.130.1.1 netmask 0xffffff00 broadcast 10.130.1.255
>         ether 00:a0:24:bb:00:c4
>         media: 100baseTX (100baseTX <half-duplex>)
>         supported media: autoselect 100baseTX <full-duplex> 100baseTX <half-duplex> 100baseTX 10baseT/UTP <full-duplex> 10baseT/UTP 10baseT/UTP <half-duplex>
> lp0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> mtu 1500
> tun0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
> sl0: flags=c010<POINTOPOINT,LINK2,MULTICAST> mtu 552
> ppp0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
>         inet 127.0.0.1 netmask 0xff000000 

In this case I have network interfaces: xl0, lp0, tun0, sl0, ppp0, and lo0.

Since you don't have them configured at all you will likely not see any of the
indented information, since that is a result of the configuration ;).  The
'lp0' driver is for a parallel port PLIP interface. "sl0" is a SLIP, 'ppp0' is
for PPP.  You will not want configure any of these.  You will likely wish
to configure any remaining interface, and you must configure lo0 (the loopback
interface).  For the above example the line in /etc/rc.conf is:

network_interfaces="xl0 lo0"

Now for each interface you need to tell it what IP it has, this
is done by interface_IFNAME="options".  So for the above example it is:

ifconfig_xl0="inet 10.130.1.1 netmask 255.255.255.0"
ifconfig_lp0="inet 127.0.0.1"                   # DO NOT CHANGE THIS.

Finally you will want to setup the gateway for the system, this
is done via:

defaultrouter="IP"

In my case this is:

defaultrouter="10.130.1.254"

So that makes the *entire* network config in /etc/rc.conf be:

> network_interfaces="xl0 lo0"
> ifconfig_xl0="inet 10.130.1.1 netmask 255.255.255.0"
> ifconfig_lp0="inet 127.0.0.1"                   # DO NOT CHANGE THIS.
> defaultrouter="10.130.1.254"

That should be all you need to do, just season that information with your
own net.interfaces and pepper with your IP addresses.

--
David Cross                               | email: crossd@cs.rpi.edu 
Systems Administrator/Research Programmer | Web: http://www.cs.rpi.edu/~crossd 
Rensselaer Polytechnic Institute,         | Ph: 518.276.2860            
Department of Computer Science            | Fax: 518.276.4033
I speak only for myself.                  | WinNT:Linux::Linux:FreeBSD


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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