linux系统添加网关命令

您所在的位置:网站首页 linux增加默认网关命令是什么意思 linux系统添加网关命令

linux系统添加网关命令

2024-07-01 15:00| 来源: 网络整理| 查看: 265

route -n 查看当前网关,发现无线网络没有网关

Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.3.1 0.0.0.0 UG 0 0 0 eth0 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 10.10.80.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0 192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

#添加一个 添加的网关和ip在同一个网段:route add default gw 192.168.3.1 dev wlan0 添加的网关和ip不在同一个网段: 1、route add -host 192.168.2.3 dev eth0 2、route add default gw 192.168.2.5 dev eth0

route -n

Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.3.1 0.0.0.0 UG 0 0 0 eth0 0.0.0.0 192.168.3.1 0.0.0.0 UG 0 0 0 wlan0 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 10.10.80.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0 192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3