反掩码应用于CISCO
本实验不指任何具体的CISCO设备。xx于CISCO模拟器。
同理,在R1上有IP地址:172.16.0.1/24
在R2上面有IP地址:172.16.1.1/24
在R2上面有4个Loop接口。
Interface IP-Address
FastEthernet0/0 172.16.0.2
Loopback0 192.168.0.1
Loopback1 192.168.1.1
Loopback2 192.168.2.1
Loopback3 192.168.3.1
Loopback4 192.168.4.1
在R1上面有ACL一条:
access-list 1 deny 192.168.0.0 0.0.2.255
interface FastEthernet0/0
ip address 172.16.0.1 255.255.255.0
ip access-group 1 in
等双方都路由状态都FULL 后。在R2用PING做测试。
测试结果为:
IP段
通?
192.168.0.1/32
不通
192.168.1.1/32
通
192.168.2.1/32
不通
从上面的表可以看出。这儿的不连续反掩码是有生效的。
所以证明在CISCO中也支持不连续的反掩码。
Router#ping ip
Target IP address: 172.16.0.1
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 192.168.0.1
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.0.1
U.U.U
Success rate is 0 percent (0/5)
Router#ping ip
Target IP address: 172.16.0.1
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 192.168.1.1
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/28/60 ms
Router#pin gip
Translating “gip”
Translating “gip”
% Unrecognized host or address, or protocol not running.
Router#ping ip
Target IP address: 172.16.0.1
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 192.168.2.1
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.2.1
U.U.U
Success rate is 0 percent (0/5)
Router#