Note: These instructions assume that you have a Macintosh already
running NetBSD 1.3x. Note that some of these instructions will
not work for the 1.2 and 1.2.1 distributions of NetBSD. I have
tried to point out where 1.3 differs from 1.2, but I can't make any
promises. Also, if you are unclear about terminology used in sections
1 and 2, please see section 3 first.
hostname="Your Hostname"
domainname="Your Domain Name"
defaultroute="Your Gateway"
Here is how I have set it up in my example file:
hostname="binky"
domainname="lifeinhell.net"
defaultroute="202.233.42.1"
Note that this setup with the /etc/rc.conf file is new to NetBSD 1.3. For information on 1.2, see the MacBSD Networking How-To.
domain Your Domain Name
nameserver Your Name Server
nameserver Another Name Server (Optional)
lookup bind file
Here is how I have set it up in my example file:
domain lifeinhell.net
nameserver 202.233.42.2
nameserver 210.132.192.6
lookup bind file
You really only need one name server entry, but if your network has more than one (and it really should), then add in the second (or third). If you would like the name resolver to check your /etc/hosts before it checks the name server, change the final line to:
lookup file bind
inet Your IP Address netmask Your Netmask
Here is how I have set it up in my example file:
inet 202.233.42.4 netmask 255.255.255.0
The actual filename that you need to create depends on the type of Ethernet card or interface that you have. On the mac68k-port, the two most common type are ae for Apple Ethernet and sn for Sonic. You can use the dmesg command to examine your boot log and see what interface, if any, that NetBSD has recognized. On my IIcx with a Asante Mac-Con ethernet card, I get:
ae0 at nubus0 slot 9: MacCon Ethernet, 32KB memory
ae0: Ethernet address 00:00:94:61:3d:e5
Therefore, I have created a /etc/ifconfig.ae0 file. On my Centris 650, I am using on-board Ethernet which uses the Sonic chip-set. At boot time, I get:
sn0 at obio0 address 08:00:07:0c:97:23
Therefore, I have created a /etc/ifconfig.sn0 file on my Centris 650. Note: The use of the /etc/ifconfig.xxN is not found in the 1.2 distribution. See the MacBSD Networking How-To for information on setting up a /etc/hostname.xxN file.
10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255
In my case, I decided to use a single class C block 192.168.3.0. Since I am using a class C, my netamsk will be 255.255.255.0.
Domain Name: giganet.net (my ISP)
Host 1: ratbert 192.168.3.1 (Centris 650 running NetBSD)
Host 2: bullwinkle 192.168.3.2 (Mac IIcx running NetBSD)
Host 3: bob 192.168.3.3 (IBM Thinkpad running FreeBSD)
Host 4: macos 192.168.3.4 (Mac IIvi running MacOS)

Diagram of My LAN
hostname="Your Hostname"
domainname="Your Domain Name"
defaultroute=""
It is important to leave the defaultroute line blank. Here is how I have set it up on my Centris 650:
hostname="ratbert"
domainname="giganet.net"
defaultroute=""
Note that this setup with the /etc/rc.conf file is new to NetBSD 1.3. For information on 1.2, see the MacBSD Networking How-To.
domain Your Domain Name
lookup file
This tells NetBSd to use the /etc/hosts file to lookup the hostname to IP address mappings. If you also connect to the Internet via PPP on the same machine, you will want to set it up as follows:
domain Your Domain Name
nameserver Your Provider's Name Server
nameserver Another Name Server (Optional)
lookup file bind
This tells NetBSD to first check the /etc/hosts file and use the name servers if it cannot find an entry in the /etc/hosts file. Since Ratbert also connects to the Internet via PPP, here is how I have set it up on my C650:
domain giganet.net
nameserver 203.182.192.135
nameserver 203.182.192.35
lookup file bind
127.0.0.1 localhost localhost.giganet.net
192.168.3.1 ratbert ratbert.giganet.net
192.168.3.2 bullwinkle bullwinkle.giganet.net
192.168.3.3 bob bob.giganet.net
192.168.3.4 macos macos.giganet.net
The /etc/hosts for all three *BSD machines is the exact same.
inet Your IP Address netmask Your Netmask
Here is how I have set it up in my /etc/ifconfig.sn0 file on Ratbert:
See Section 1 above if you do not understand how to determine the "xxN" part of the filename.
inet 192.168.3.1 netmask 255.255.255.0
Aagain, once you have your network setup, you might want to consider using IP-NAT. Armen Babikyan wrote up an excellent IP-NAT How-To. With IP-NAT, you can connect to the Internet from any machine on your LAN over a single PPP connection at the same time!
FAQ 1: Should I run routed?
Simple answer: No!
Long answer: No you should not. The routed daemon is the
UN*X implementation of the RIP routing protocol. There is no need to
use routing since you only have a single network. A general rule of
thumb is that you do not need a routing protocol unless you have two
Ethernet cards.
FAQ 2: Should I run named?
Simple answer: No!
Long answer: No you should not. The named daemon (also
known as BIND) acts as a DNS server. If you do not have a permanent
Internet connection, there is no need to run named. In fact,
running named could cause problems with a stand alone LAN.
Use the /etc/hosts file to map your hostnames to IP
addresses.
Back to my Mark's MacBSD How-To Index.