Serial端口推送地址實驗
一、實驗目的
路由器Serial端口可以通過配置地址推送,讓對端路由器Serial端口通過協商獲取到IP地址。不是通過DHCP的方式。
二、實驗環境
兩臺路由器通過Setial 1/0/0端口互聯,AR1配置IP 10.0.0.1/24,推送地址爲20.0.0.1,AR2路由器Serial 1/0/0地址配爲協商獲取。
三、實驗內容
1.AR1配置命令
[AR1]interface Serial 1/0/0
[AR1-Serial1/0/0]ip address 10.0.0.1 24 \\配置本地Serial端口地址
[AR1-Serial1/0/0]remote address 20.0.0.1 \\配置對端協商獲取的地址
2.AR2配置命令
[AR2]interface Serial 1/0/0
[AR2-Serial1/0/0]ip address ppp-negotiate \\配置地址自動協商
3.查看AR2的Serial 1/0/0端口獲取的地址
[AR2]dis ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 unassigned down down
GigabitEthernet0/0/1 unassigned down down
NULL0 unassigned up up(s)
Serial1/0/0 20.0.0.1/32 up up
Serial1/0/1 unassigned down down
可以看出Serial1/0/1獲得了20.0.0.2的主機地址。
雖然兩端的地址不在同一網段,但路由表中已經產生對端的直連路由。
4.查看AR1的路由表
[AR1]display ip routing-table
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/24 Direct 0 0 D 10.0.0.1 Serial1/0/0
10.0.0.1/32 Direct 0 0 D 127.0.0.1 Serial1/0/0
10.0.0.255/32 Direct 0 0 D 127.0.0.1 Serial1/0/0
20.0.0.1/32 Direct 0 0 D 20.0.0.1 Serial1/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1
5.查看AR2的路由表
[AR2]display ip interface brief
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.1/32 Direct 0 0 D 10.0.0.1 Serial1/0/0
20.0.0.1/32 Direct 0 0 D 127.0.0.1 Serial1/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
6.測試AR1與AR2互通性
[AR1]ping -a 10.0.0.1 20.0.0.1
測試兩端可以互通
四、實驗總結
AR2通過地址協商獲得的地址是掩碼爲32位的主機地址,由於PPP鏈路是P2P的,就算與對端不在同一網段也能正常通訊。