七:添加网关
route add default gw 192.168.0.1
成功后可通过route指令查询:
[root@x210ii /]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 wlan0
[root@x210ii /]# route add default gw 192.168.0.1
[root@x210ii /]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 wlan0
default 192.168.0.1 0.0.0.0 UG 0 0 0 wlan0
[root@x210ii /]#
八:ping外网
[root@x210ii /]# ping 58.63.236.39
PING 58.63.236.39 (58.63.236.39): 56 data bytes
64 bytes from 58.63.236.39: seq=0 ttl=55 time=2903.754 ms
64 bytes from 58.63.236.39: seq=1 ttl=55 time=2990.038 ms
64 bytes from 58.63.236.39: seq=2 ttl=55 time=2963.814 ms
64 bytes from 58.63.236.39: seq=3 ttl=55 time=3113.067 ms
64 bytes from 58.63.236.39: seq=4 ttl=55 time=2949.479 ms
64 bytes from 58.63.236.39: seq=5 ttl=55 time=2371.217 ms
64 bytes from 58.63.236.39: seq=6 ttl=55 time=1503.418 ms