首页 > 系统服务 > 详细

linux网络命令

时间:2014-08-23 02:31:20      阅读:367      评论:0      收藏:0      [点我收藏+]

一、linux下添加路由

1、添加默认网关:route add default gw 192.168.1.1 或 route add default dev eth1

2、添加路由:route add -net 172.16.1.0 netmask 255.255.255.0 gw 172.16.1.1

             route add -net 172.16.1.0 netmask 255.255.255.0 dev eth0

3、添加一个主机路由:route add -host 172.16.1.1 gw 172.16.1.10

                     route add -host 172.16.1.1 dev eth0

4、删除:route del [default/-host/-net]

5、查看路由:route -n 或 netstat -rn

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.60.3    192.168.60.1    255.255.255.255 UGH   0      0        0 eth1

172.17.46.0     172.17.46.1     255.255.255.0   UG    0      0        0 eth0

172.17.46.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

192.168.60.0    0.0.0.0         255.255.255.0   U     0      0        0 eth1

0.0.0.0         172.17.46.1     0.0.0.0         UG    0      0        0 eth0

0.0.0.0         192.168.60.2    0.0.0.0         UG    0      0        0 eth1


本文出自 “laoyaowst” 博客,请务必保留此出处http://laoyaowst.blog.51cto.com/6113216/1543566

linux网络命令

原文:http://laoyaowst.blog.51cto.com/6113216/1543566

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!