freeBSD系统网络配置

1385阅读 0评论2011-06-02 
分类:系统运维

配置网卡IP:
ifconfig   <网卡名称>   <子网掩码>
ifconfig   <网卡名称>   down  //关闭网卡
ifconfig   <网卡名称>   up       //启动网卡
示例:
ifconfig  em1  192.168.1.2  255.255.255.0
ifconfig  em1  down
ifconfig  em1  up
配置路由:
route  add  网络号/掩码  网关
示例:
route  add 192.168.2.0/24  192.168.1.1
开启自启动配置:
vi /etc/rc.conf
   ifconfig_em1="inet" 192.168.1.2 netmask 255.255.255.0
   route add 192.168.2.0/24 192.168.1.1
   defaultrouter= “ 192.168.1.254 ”         //默认路由
删除路由配置:
route delete default                               //删除默认路由
 netstat -r                                                //查看本机路由表 
上一篇:没有了
下一篇:DNS服务器维护命令