FreeBSD网卡配置

Standard

网卡配置文件位于/etc/rc.conf,在编辑此文件前可使用ifconfig -a来查看网卡名称,如网卡名为”eth0″

#网关地址
defaultrouter="192.168.0.1"
#IP地址及子网掩码
ifconfig_eth0="inet 192.168.0.3 netmask 255.255.255.0"

网卡重启命令如下:
ifconfig eth0 down #STOP网卡eth0
ifconfig eth0 up #START网卡eth0
/etc/rc.d/netif restart #所有网卡重启
/etc/rc.d/netif restart && /etc/rc.d/routing restart

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.