Rhy*_*Ink 6 linux routing iproute
我正在学习Linux路由,路由表,IP路由等......以下是输出,ip route其次是输出route:
default via 192.168.1.1 dev wlp0s20f3 proto dhcp metric 600
169.254.0.0/16 dev wlp0s20f3 scope link metric 1000
192.168.1.0/24 dev wlp0s20f3 proto kernel scope link src 192.168.1.103 metric 600
Run Code Online (Sandbox Code Playgroud)
Destination Gateway Genmask Flags Metric Ref Use Iface
default pfSense.localdo 0.0.0.0 UG 600 0 0 wlp0s20f3
link-local 0.0.0.0 255.255.0.0 U 1000 0 0 wlp0s20f3
192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp0s20f3
Run Code Online (Sandbox Code Playgroud)
所以,我从 route 的输出中了解到,任何路由到我的本地网络 192.168.1.0/24 的东西都在本地网络上,所以接口基本上是未指定的。与发送到本地链接的任何内容(我认为这是我的环回设备)相同。最后,任何路由到其他任何东西的东西都被发送到默认网关,即我的路由器。希望我做对了。
我在解析ip route. 我可以看到我的默认网关显然是什么,但我无法将其他两行与route. 我已经阅读了文档并幸运地学到了很多东西,但除了告诉我接口和目的地的事实之外,我无法找到任何关于命令输出的具体信息。如果有人可以为我分解一行并解释如何阅读它,我将不胜感激!
曾经回答过这个问题的人的一些相关链接:
小智 1
链接本地(我相信是我的环回设备)。
链路本地(the 169.254.0.0/16)是一个特殊的子网。环回设备为“lo”和 127.0.0.1,以及scope hostLOOPBACK(带有ip a)
另外两行ip route show可以用以下命令创建:
ip address add 192.168.0.16/24 dev eth0
ip route add 192.168.0.0/24 dev eth0
ip route add default via 192.168.0.1
Run Code Online (Sandbox Code Playgroud)
这与此 (dhcp) 相同,只是地址不同(15 与 16):
default via 192.168.0.1 dev eth0 proto dhcp src 192.168.0.15 metric 202
192.168.0.0/24 dev eth0 proto dhcp scope link src 192.168.0.15 metric 202
Run Code Online (Sandbox Code Playgroud)
对于那些曾经回答过这个问题的人来说,一些相关链接
???
| 归档时间: |
|
| 查看次数: |
4666 次 |
| 最近记录: |