FreeBSD設定網路卡IP與routing
FreeBSD設定網路卡IP與routing
Step1)編輯/etc/rc.conf
#vi /etc/rc.conf
ifconfig_dc0="inet 192.168.0.22 netmask 255.255.255.0",新增IP與子網路遮罩,rm0為網卡代號,使用ifconfig可以查到
defaultrouter="192.168.0.254",新增routing的設定
Step2)重新啟動網路與routing
#service netif restart
#service routing restart
Step3)編輯/etc/resolv.conf,設定DNS
#vi /etc/resolv.conf,新增DNS主機IP