给FreeBSD设置静态IP和DNS
1.Set IP address and default router
# ee /etc/rc.conf
Add content as following into rc.conf
.
ifconfig_em0="inet 192.168.1.18 netmask 255.255.255.0"
defaultrouter="192.168.1.1"
save it,push buttons ESC
,A
,A
.
2.Setting up DNS
# ee /etc/resolv.conf
Content of resolv.conf
nameserver 8.8.8.8
nameserver 1.1.1.1
save it,push buttons ESC
,A
,A
.
3. Restart network
# sh /etc/rc
# /etc/netstart