大家好,我们接着上篇来!希望有错误的地方请指出!谢谢!
第二篇:GRE的中转和互联
拓扑:
步骤:
注:R4为ISP的路由器,只有公网的路由,也就是说在此拓扑中R4只有直连的路由。
R1的配置:
hostname R1
!
!
!
ip name-server 0.0.0.0
!
!
interface Tunnel0
 ip address 10.0.0.2 255.255.255.0
 tunnel source Serial0/0/0
 tunnel destination 202.102.102.2
!
!
interface Tunnel1
 ip address 20.0.0.1 255.255.255.0
 tunnel source Serial0/0/0
 tunnel destination 202.102.101.2
!
!
interface FastEthernet0/0
 ip address 1.1.1.254 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 202.102.100.2 255.255.255.252
!
interface Serial0/0/1
 no ip address
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 Serial0/0/0
ip route 3.3.3.0 255.255.255.0 10.0.0.1
ip route 2.2.2.0 255.255.255.0 20.0.0.2
R2的配置:
hostname R2
!
!
!
ip name-server 0.0.0.0
!
!
!
interface Tunnel1
 ip address 20.0.0.2 255.255.255.0
 tunnel source Serial0/0/0
 tunnel destination 202.102.100.2
!
!
interface FastEthernet0/0
 ip address 2.2.2.254 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 202.102.101.2 255.255.255.252
!
interface Serial0/0/1
 no ip address
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 202.102.101.1
ip route 1.1.1.0 255.255.255.0 20.0.0.1
ip route 2.2.2.0 255.255.255.0 20.0.0.1
R3的配置:
hostname R3
!
!
ip name-server 0.0.0.0
!
!
interface Tunnel0
 ip address 10.0.0.1 255.255.255.0
 tunnel source Serial0/0/0
 tunnel destination 202.102.100.2
!
!
interface FastEthernet0/0
 ip address 3.3.3.254 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 202.102.102.2 255.255.255.252
!
interface Serial0/0/1
 no ip address
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 202.102.102.1
ip route 1.1.1.0 255.255.255.0 10.0.0.2
ip route 3.3.3.0 255.255.255.0 10.0.0.2
注意:由于站点之间的连接是边界路由器所以必须有一条去往Internet的默认路由。这样站点之间才能建立隧道连接。
由于我们让R1作为中转站,所以R2和R3之间的通信要让R1中转!
(红色标记)
当然如果我们分别建立隧道也是可以的!
未完待续!