思科greVPN

思科greVPN

一、配置路由器的ip

R1能ping通R3,R2能ping通R3

二、配置默认路由

现在R1不能ping通R2,需要给R1和R2配置默认路由

1
2
3
4
R1:
R1(config)#ip route 0.0.0.0 0.0.0.0 10.10.2.1
R2:
R2(config)#ip route 0.0.0.0 0.0.0.0 103.10.10.1

三、配置隧道

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
R1:
进入接口
R1(config)#int tunnel 0
配置接口的ip
R1(config-if)#ip address 172.10.10.1 255.255.255.0
配置发送的接口,从fa0/0接口出去
R1(config-if)#tunnel source FastEthernet 0/0
配置目标ip
R1(config-if)#tunnel destination 103.10.10.2

R2:
R2(config)#int tunnel 0
R2(config-if)#ip address 172.10.10.2 255.255.255.0
R2(config-if)#tunnel source FastEthernet 0/0
R2(config-if)#tunnel destination 10.10.2.2

在R1上pingR2无法ping通

R1#ping 10.10.2.2

四、配置ospf

1、现在使用PC1pingPC2还是不通没有路由,需要用ospf学习到对面网络的路由

1
2
3
4
5
6
7
8
9
10
11
12
13
14
R1:
进入id为1的ospf进程
router ospf 1
设置id为192.168.10.1
router-id 192.168.10.1
将172.10.10.0加入到进程中
network 172.10.10.0 0.0.0.255 area 0
将192.168.10.0加入到进程中
network 192.168.10.0 0.0.0.255 area 0
R2:
router ospf 1
router-id 192.168.20.1
network 172.10.10.0 0.0.0.255 area 0
network 192.168.20.0 0.0.0.255 area 0

2、在R1上查看路由

五、测试

在PC1上pingPC2

六、抓包分析

这个数据包添加了gre头