To configure a static IP, gateway and DNS in BSD is very simple, this time we are going to see how to configure the network interface in FreeBSD and OpenBSD.
FreeBSD
To configure the IP addressing and the gateway we must add the following to the file /etc/rc.conf
Bash
ifconfig_em0=»inet 192.168.1.110 netmask 255.255.255.0″
defaultrouter=»192.168.1.1″To configure DNS resolution is in /etc/resov.conf
text
search red-orbita.com
nameserver 192.168.1.10
nameserver 192.168.1.11We restart the network service
text
/etc/rc.d/netif restartOpenBSD
In the case of OpenBSD, to configure IP addressing we must add the following in /etc/hostname.em0
Bash
cat /etc/hostname.em0
inet 192.168.1.110 255.255.255.0 192.0.0.255To configure the gateway we create the file /etc/mygate
Bash
cat /etc/hostname.em0
192.168.1.1To configure DNS resolution is in /etc/resov.conf
text
search red-orbita.com
nameserver 192.168.1.10
nameserver 192.168.1.11
lookup file bindWe restart the network service
text
sh /etc/netstartall the best.
:wq!
Comments