interface Loopback0
ip address 10.1.1.1 255.255.255.0
interface FastEthernet0/0
ip address 192.168.12.1 255.255.255.0
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
R2:
interface Loopback0
ip address 10.2.2.2 255.255.255.0
interface FastEthernet0/0
ip address 192.168.12.2 255.255.255.0
ip route 10.1.1.0 255.255.255.0 FastEthernet0/0
简单的配置如上,现在测试结果:
R1#ping 10.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.2, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 4/40/96 ms
往后在R1全局配置模式下多了一条命令no ip classless ,结果
R2#ping 10.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
现在的问题是多的这条命令no ip classless ,不通了...
1、ip classless这条命令是作用于路由转发进程的,告诉路由器工作在无类环境下
2、它能让路由器超越有类网络的边界而根据最长匹配条目来转发数据包;
3、当目的网络没有出现在路由表中时通过默认路由转发数据包,而不是简单的丢弃
4、如果路由器工作在有类环境下,当目的网络出现在路由表中,但没有具体的网络 匹配时,将丢弃数据包。