FreeBSD路由-网络配置学习笔记

注意:本文最后更新于 2530 天前,有关的内容可能已经发生变化,请参考使用。

修改IP

即时生效的修改IP

    ifconfig le0 192.168.203.33 netmask 255.255.255.0  

永久修改需要在/etc/rc.conf中添加

    ifconfig_le0=“192.168.203.33 netmask 255.255.255.0”  

修改网关

即时生效

    route add default 192.168.203.255  

永久修改在/etc/rc.conf中添加

    defaultrouter=“192.168.203.255”

添加和删除静态路由

    netstat -nr  

命令修改用

    route add 192.168.40.0 -netmask 255.255.255.0 192.168.1.253  
    route add -host 192.168.30.122 -iface -link xl0:0:12:3f:2:3:4 #目标为MAC  
    route add -host 192.168.20.0 192.168.1.253 #指定-host参数为一个单独的远程计算机指定路由  

永久修改在/etc/rc.conf中添加

    static_routes= “ static1 static2 ”  
    route_static1= “ -net 192.168.10.0/24 192.168.1.253 ”  
    route_static2= “ -net 192.168.20.0/24 192.168.1.253 ”  

修改DNS服务器

    nameserver 202.101.208.3  

显示当前路由表


    netstat -nr

「倘若有所帮助,不妨酌情赞赏!」

Holmesian

感谢您的支持!

使用微信扫描二维码完成支付


相关文章

发表新评论