시스템 부팅시 자동으로 NIC 에 IP 를 할당하고 싶다면 /etc/rc.conf 파일을 이용한다.
rc.conf 설정 예제.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | root@FBSD10: /etc # vi rc.conf hostname = "FBSD10" #ifconfig_em0="DHCP" ifconfig_em0= "10.0.2.16/24" ifconfig_em0_ipv6= "inet6 accept_rtadv" sshd_enable= "YES" ntpd_enable= "YES" # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable dumpdev= "AUTO" # Set for em1 ifconfig_em1= "192.168.200.12/24" # Set for em2 ifconfig_em2= "192.168.201.12/24" # Default route gateway defaultrouter= "10.0.2.2" |
rc.conf 파일은 NIC 설정외에도 다양한 기능들을 지원한다. 리눅스의 /etc/rc.local 파일을 생각하면 되겠다.
이보다 더 자세한 옵션들을 보고 싶다면..
$ man rc.conf
/etc/rc.conf 파일 설정 이후, 재부팅없이 네트워크를 Up/Down/Restart 를 해야 한다면 다음을 활용하자.
Netowrk Restart
$ /etc/rc.d/netif restart
Network Down
$ /etc/rc.d/netif stop
Network Up
$ /etc/rc.d/netif start
Routing Table 도 마찬가지로 조작이 가능하다.
Network routing table Restart
$ /etc/rc.d/routing restart
출처 : http://www.cyberciti.biz/tips/freebsd-how-to-start-restart-stop-network-service.html