通过上一个实验可以看出RIPV1无法携带子网信息,无法关闭自动汇总,所以就引入下面的RIP V2版本。
[RTA]int G0/0
[RTA-Ethernet0/1/0]ip add 10.1.1.1 24
[RTA-Ethernet0/1/0]undo shutdown
[RTA-Ethernet0/1/0]int S6/0 [RTA-Ethernet0/0/0]ip add 11.1.1.1 24
[RTA-Ethernet0/0/0]undo shutdown
[RTB]int S6/0 [RTB-Ethernet0/0/0]ip add 11.1.1.2 24
[RTB-Ethernet0/0/0]undo shutdown
[RTB-Ethernet0/0/0]int G0/0
[RTB-LoopBack1]ip add 12.1.1.1 24
[RTA]rip 1
[RTA-rip-1]undo summary 关闭自动汇总
[RTA-rip-1]undo summary
[RTA-rip-1]ver 2
[RTA-rip-1]network 10.1.1.0
[RTA-rip-1]network 11.1.1.0
[RTB]rip 1
[RTB-rip-1]undo summary
[RTB-rip-1]undo summary
[RTB-rip-1]ver 2
[RTB-rip-1]network 12.1.1.0
[RTB-rip-1]network 11.1.1.0
此时可以看到RIP V2是携带子网信息的:
[H3C-rip-1]disp ip routing-table
Routing Tables: Public
Destinations : 6 Routes : 6
Destination/Mask Proto Pre Cost NextHop Interface
10.1.1.0/24 RIP 100 1 11.1.1.1 S6/0
11.1.1.0/24 Direct 0 0 11.1.1.2 S6/0 11.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
12.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
PC间可相互访问:
C:\Documents and Settings\xiaofei>ping 12.1.1.2
Pinging 12.1.1.2 with 32 bytes of data:
Reply from 12.1.1.2: bytes=32 time=1ms TTL=254
Reply from 12.1.1.2: bytes=32 time=1ms TTL=254
Reply from 12.1.1.2: bytes=32 time=1ms TTL=254
Reply from 12.1.1.2: bytes=32 time<1ms TTL=254
Ping statistics for 12.1.1.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
C:\Documents and Settings\xiaofei>
如果希望接口接受不发送RIP信息,可以接口设置为被动接口,这样也可以隐藏网络。
[H3C]rip 1
[H3C-rip-1]silent-interface G0/0