首页 技术 正文
技术 2022年11月20日
0 收藏 947 点赞 2,303 浏览 1102 个字

不管是在window还是在linux中,我们经常会遇到ping不通的问题。

这里的原因很多,比如不同的网段交换机做了一些限制等,这些问题是我们人工不能解决的。

但是,当你发现各自的网关是可以ping的通的时候,那这个时候也许你会一头雾水。起始问题并不大,就是route table有问题。路由表出问题的原因大部分是交换机出了问题。

上面只是说了一些问题的所在,具体路由表的配置:

linux下:

第一种方法,使用route命令。 第二种方法无非是修改/etc/rc.local,只是要注意的一点是不要卸载 “exit 0″的后面,这样就等于白写了 第三种就是修改interfaces文件了,写在文件的末尾,基本格式如下:up route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1可以看到这个格式和route命令的唯一区别在于,在前面多了一个up下面列出我的interface文件仅供参考,由于安全因素,这里的ip我都用xx替代了:# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5). # The loopback network interfaceauto loiface lo inet loopback # The primary network interfaceauto eth0iface eth0 inet staticaddress xxx.xxx.xxx.xxxnetmask xxx.xxx.xxx.xxxgateway xxx.xxx.xxx.xxx auto eth0:0iface eth0:0 inet staticaddress xxx.xxx.xxx.xxxnetmask xxx.xxx.xxx.xxx #dns-nameservers 202.102.224.68 202.102.227.68up route add -net xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx gw xxx.xxx.xxx.xxx eth0up route add -net xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx gw xxx.xxx.xxx.xxx eth0up route add -net xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx gw xxx.xxx.xxx.xxx eth0

在window下:

运行直接用cmd命令行,route命令。百度吧,一大堆!

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,022
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,513
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,359
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,142
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,773
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,851