ImageVerifierCode 换一换
格式:DOCX , 页数:6 ,大小:16.01KB ,
资源ID:7362486      下载积分:1 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-7362486.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(linux 路由表功能解析.docx)为本站会员(b****5)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

linux 路由表功能解析.docx

1、linux 路由表功能解析linux 路由表功能解析 linux 路由表功能解析分类: 网络2013-11-16 18:23 1268人阅读 评论(0) 收藏 举报网络局域网路由器linux 路由表功能解析 本文,简单描述一下路由的作用.简单来说,路由器就是一个公交站台,公交站台上面有很多路公交.每条线路公交车又有很多站台(路由器),你就会选择最近的一条公交出行方案,当然啦,站牌上面的路线是会经常更新,更新的事,有当地部门更新.这就是路由.一台电脑主机有路由表,路由器也有路由表,一般来说,一台主机电脑如果只有一个网卡的话,应该会有最少两条路由信息,一条是公网路由,一条是局域网路由(它是不会经过

2、路由器的路由表的,因为它走的是链路层,所以可以解析我们在局域网内传数据,速度是很快的). 测试环境:主机(linux): ip:192.168.168.1.119 netmask:255.255.0.0另一台主机(xp): ip:192.168.1.133 netmask:255.255.0.0 网关: ip:192.168.0.3 netmask: 255.255.248.0 一, 我们可以查看一下路由表.(route 命令)user:dvr_linux routeKernel IP routing tableDestination Gateway Genmask Flags Metric

3、Ref Use Ifacedefault 192.168.0.3 0.0.0.0 UG 0 0 0 eth0 /公网路由信息 /U Up, G Gateway, H Host192.168.0.0 * 255.255.0.0 U 0 0 0 eth0 /局域网路由信息.user:dvr_linux Flags 可能出现的标志有: U (route is up) 路由正常 H (target is a host) 主机路由 G (use gateway) 使用网关的间接路由 R (reinstate route for dynamic routing) 为动态选路恢复路由 D (dynamica

4、lly installed by daemon or redirect) 该路由由选路进程或重定向动态创建 M (modified from routing daemon or rederict) 该路由已由选路进程或重定向修改 ! (reject route) 阻塞路由 1.1 测试公网路由(切换到root用户下):root:dvr_linux route /打印路由表Kernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Ifacedefault 192.168.0.3 0.0.0.0 UG 0 0 0

5、 eth0192.168.0.0 * 255.255.0.0 U 0 0 0 eth0root:dvr_linux ping 8.8.8.8 / 8.8.8.8是google公司的dns.PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.64 bytes from 8.8.8.8: icmp_req=2 ttl=48 time=10.4 ms64 bytes from 8.8.8.8: icmp_req=3 ttl=48 time=10.0 ms /正常C- 8.8.8.8 ping statistics -3 packets transmitted, 2

6、 received, 33% packet loss, time 2013msrtt min/avg/max/mdev = 10.024/10.222/10.421/0.222 msroot:dvr_linux route del default dev eth0 /删除默认路由,也就公网路由,因为有网关.root:dvr_linux routeKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface192.168.0.0 * 255.255.0.0 U 0 0 0 eth0root:dvr_li

7、nux ping 8.8.8.8connect: Network is unreachable /ping 不通,没找到路由信息.数据包出不去.root:dvr_linux route add default dev eth0 /增加默认路由,没加网关.root:dvr_linux routeKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Ifacedefault * 0.0.0.0 U 0 0 0 eth0192.168.0.0 * 255.255.0.0 U 0 0 0 eth0root:dvr

8、_linux ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.From 192.168.1.119 icmp_seq=1 Destination Host Unreachable /ping 不通,找到路由信息.但是找不到去8.8.8.8胡线路,数据包出不去.From 192.168.1.119 icmp_seq=2 Destination Host UnreachableFrom 192.168.1.119 icmp_seq=3 Destination Host UnreachableC- 8.8.8.8 ping stati

9、stics -5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4010mspipe 3root:dvr_linux route del default dev eth0root:dvr_linux routeKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface192.168.0.0 * 255.255.0.0 U 0 0 0 eth0root:dvr_linux route add default gw

10、192.168.0.3 dev eth0root:dvr_linux routeKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Ifacedefault 192.168.0.3 0.0.0.0 UG 0 0 0 eth0192.168.0.0 * 255.255.0.0 U 0 0 0 eth0root:dvr_linux ping 8.8.8.8PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.64 bytes from 8.8.8.8: icmp_req=1

11、 ttl=48 time=11.0 ms /重新添加带网关的路由信息后,又能ping 通了.64 bytes from 8.8.8.8: icmp_req=3 ttl=48 time=10.0 ms64 bytes from 8.8.8.8: icmp_req=4 ttl=48 time=10.3 msC- 8.8.8.8 ping statistics -4 packets transmitted, 3 received, 25% packet loss, time 3015msrtt min/avg/max/mdev = 10.037/10.496/11.071/0.445 msroot:

12、dvr_linux 1.2 测试局域网路由(切换到root用户下):root:dvr_linux routeKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Ifacedefault 192.168.0.3 0.0.0.0 UG 0 0 0 eth0192.168.0.0 * 255.255.0.0 U 0 0 0 eth0root:dvr_linux ping 192.168.1.133PING 192.168.1.133 (192.168.1.133) 56(84) bytes of data.6

13、4 bytes from 192.168.1.133: icmp_req=1 ttl=64 time=2.13 ms64 bytes from 192.168.1.133: icmp_req=2 ttl=64 time=0.450 ms /正常通过.C- 192.168.1.133 ping statistics -2 packets transmitted, 2 received, 0% packet loss, time 1003msrtt min/avg/max/mdev = 0.450/1.290/2.131/0.841 msroot:dvr_linux route del -net

14、192.168.0.0/16 dev eth0 /删除局域网路由root:dvr_linux routeKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Ifacedefault 192.168.0.3 0.0.0.0 UG 0 0 0 eth0root:dvr_linux ping 192.168.1.133PING 192.168.1.133 (192.168.1.133) 56(84) bytes of data.64 bytes from 192.168.1.133: icmp_req=1 t

15、tl=64 time=5.06 msFrom 192.168.0.3: icmp_seq=1 Redirect Host(New nexthop: 192.168.1.133) /数据包通过了默认路由信息发到了路由器,再查路由器的路由表找到了192.168.1.133的路由.再由网关发回来给192.168.1.133了.64 bytes from 192.168.1.133: icmp_req=2 ttl=64 time=0.477 ms64 bytes from 192.168.1.133: icmp_req=3 ttl=64 time=0.302 ms64 bytes from 192.1

16、68.1.133: icmp_req=4 ttl=64 time=0.285 ms64 bytes from 192.168.1.133: icmp_req=5 ttl=64 time=0.478 ms64 bytes from 192.168.1.133: icmp_req=6 ttl=64 time=0.408 msC- 192.168.1.133 ping statistics -6 packets transmitted, 6 received, 0% packet loss, time 5002msrtt min/avg/max/mdev = 0.285/1.169/5.066/1.

17、744 msroot:dvr_linux routeKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Ifacedefault 192.168.0.3 0.0.0.0 UG 0 0 0 eth0root:dvr_linux route del default eth0 /把默认路由都删掉的话,这就完全找不到路由信息了,也就是没网络了.root:dvr_linux routeKernel IP routing tableDestination Gateway Genmask Flags Metric R

18、ef Use Ifaceroot:dvr_linux ping 192.168.1.133connect: Network is unreachableroot:dvr_linux 在这个时候,192.168.1.133的xp主机去ping 192.168.1.119的话.也就ping 不通的.C:Documents and SettingsAdministrator>ping 192.168.1.119 -tPinging 192.168.1.119 with 32 bytes of data:Request timed out.Request timed out.Request ti

19、med out.Request timed out.Request timed out.Request timed out.Request timed out.Request timed out.Request timed out.Request timed out.Request timed out.Request timed out.Request timed out.Request timed out.Request timed out.Request timed out. root:dvr_linux service networking restart /重启一下网络.warn Ru

20、nning /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces . (warning). Reconfiguring network interfaces.RTNETLINK answers: No such processdone.root:dvr_linux root:dvr_linux routeKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Ifacedefault

21、 192.168.0.3 0.0.0.0 UG 0 0 0 eth0192.168.0.0 * 255.255.0.0 U 0 0 0 eth0root:dvr_linux 在这个时候,192.168.1.133的xp主机去ping 192.168.1.119的话.网络恢复了.C:Documents and SettingsAdministrator>ping 192.168.1.119 -tPinging 192.168.1.119 with 32 bytes of data:Request timed out.Request timed out.Request timed out.R

22、equest timed out.Request timed out.Reply from 192.168.1.119: bytes=32 time=2ms TTL=64Reply from 192.168.1.119: bytes=32 time<1ms TTL=64Reply from 192.168.1.119: bytes=32 time<1ms TTL=64Reply from 192.168.1.119: bytes=32 time<1ms TTL=64Reply from 192.168.1.119: bytes=32 time<1ms TTL=64Reply from 192.168.1.119: bytes=32 time<1ms TTL=64Reply from 192.168.1.119: bytes=32 time=6ms TTL=63Reply from 192.168.1.119: bytes=32 time<1ms TTL=64Reply from 192.168.1.119: bytes=32 time<1ms TTL=64Reply from 192.168.1.119: bytes=32 time<1ms TTL=64

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2