Initial configuration

Network setup

by ross at 18:00:25 on March 20, 2014

You can initialize a network interface by creating file start_if.<interface name>. Here we will enable device polling (requires DEVICE_POLLING option in kernel) and set media manually.


ifconfig rl0 polling media 100baseTX mediaopt full-duplex


ifconfig nfe0 polling media 100baseTX mediaopt full-duplex

When setting the media manually make sure both ends of the connection are set manually and identically. Or better just ommit media and mediaopt options for auto-negotiation.

/etc/resolv.conf (with local DNS server running):

search local


--- /usr/src/etc/dhclient.conf  2010-12-21 19:09:25.000000000 +0200
+++ /etc/dhclient.conf  2011-03-01 14:13:30.000000000 +0200
@@ -6,3 +6,17 @@
 #      In most cases an empty file is sufficient for most people as the
 #      defaults are usually fine.
+timeout 60;
+retry 60;
+reboot 10;
+select-timeout 5;
+initial-interval 2;
+interface "re0" {
+        send dhcp-lease-time 86400;
+        supersede host-name "coffin";
+        supersede domain-name "local";
+        # The following requires local DNS server
+        prepend domain-name-servers;


--- /usr/src/etc/hosts  2010-12-21 19:09:25.000000000 +0200
+++ /etc/hosts  2011-03-01 14:14:08.000000000 +0200
@@ -29,3 +29,5 @@
 # numbers but instead get one from your network provider (if any) or
 # from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)
+            coffin.lan coffin
+           striker.lan striker

Packet Filter

If you prefer ipfw it's about time to setup your firewall. If you use pf read on.

Have a look at my pf.conf if you don't have your own.

Add to /etc/rc.conf:

# Enable PF

If you change your pf.conf you can reload firewall with this command:

# pfctl -f /etc/pf.conf