描述:ide
R1和R3模擬上海和北京辦公區的邊界路由,且已經啓用PAT。spa
ISP模擬公網和公網服務器。ISP已經啓用Telnet(Password:123,enable Password:321)和HTTP服務;blog
R2和R4模擬上海和北京的內網主機。ip
現R2能夠和R3通訊,但不能與R4通訊;R4能夠與R1通訊,但不能與R2通訊。路由
要求:get
在R1和R3間建立GRE隧道,使R2和R4可以通訊。it
R1配置腳本:io
conf tclass
int tunnel 1//隧道編號爲1,本地有效
ip add 1.1.1.1 255.255.255.0
no shut
tunnel source 100.1.1.1
tunnel destination 200.1.1.1
keepalive 5 3 //配置隧道探測,每5秒向隧道對端發送一個hello包,若發送3次仍沒法收到確認包則改變隧道狀態爲Down。本地有效
exit
ip route 192.168.1.0 255.255.255.0 tunnel 1
R3配置腳本:
conf t
int tunnel 3
ip add 1.1.1.2 255.255.255.0
no shut
tunnel source 200.1.1.1
tunnel destination 100.1.1.1
keepalive 10 3
exit
ip route 10.1.1.0 255.255.255.0 tunnel 3
R2 TELNET R4時包頭結構以下: