
1、连接上相应的linux主机,进入到等待输入shell指令的linux命令行状态下。
2、在linux命令行下输入shell指令:route -n。
3、键盘按“回车键”运行shell指令,此时会看到系统的路由表信息。
linux的路由设置命令主要是route:1、添加路由命令: route add -net 192.168.0.0/24 gw 192.168.0.1 增加一个到192.168.X.X的网段,网关为192.168.0.1。
2、删除路由命令:route del -net 192.168.0.0/24 gw 192.168.0.1
3、新增默认路由:route add default gw 192.168.0.1
4、查询路由表 : route -n
运行 route 命令,你会看到一组路由设置的输出Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U0 0 0eth0
169.254.0.0 * 255.255.0.0 U0 0 0eth0
default192.168.0.1 0.0.0.0 UG 0 0 0eth0
其中,default那条路由对应的IP地址 -- 本例中是 192.168.0.1就是无线路由器地址。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)