GRE隧道的配置
1, 在AR1上配置DHCP接口地址池,AR3上配置DHCP全局地址池
2, PC1获取的IP地址为10.10.10.253,PC2获取的IP地址为10.10.30.253
3,通过ip route-static将目的地址为10.10.30.253的流量引入到Tunnel
#配置AR1
sysname AR1
interface GigabitEthernet0/0/1ip address 120.120.120.1 255.255.255.0
quit
ospf 1 router-id 1.1.1.1 area 0.0.0.0 network 120.120.120.1 0.0.0.0quitquit
dhcp enable
interface GigabitEthernet0/0/0ip address 10.10.10.254 255.255.255.0 dhcp select interface
quit
interface Tunnel0/0/0ip address 10.10.13.1 255.255.255.252 tunnel-protocol gresource 120.120.120.1destination 130.130.130.3
quit
ip route-static 10.10.30.0 255.255.255.0 Tunnel0/0/0#配置AR2
sysname AR2
interface GigabitEthernet0/0/0ip address 120.120.120.2 255.255.255.0
quit
interface GigabitEthernet0/0/1ip address 130.130.130.2 255.255.255.0
quit
ospf 2 router-id 2.2.2.2 area 0.0.0.0 network 120.120.120.2 0.0.0.0network 130.130.130.2 0.0.0.0quit
quit#配置AR3
sysname AR3
interface GigabitEthernet0/0/1ip address 130.130.130.3 255.255.255.0
quit
ospf 3 router-id 3.3.3.3 area 0.0.0.0 network 130.130.130.3 0.0.0.0quit
quit
dhcp enable
interface GigabitEthernet0/0/0ip address 10.10.30.254 255.255.255.0 dhcp select global
quit
ip pool 30gateway-list 10.10.30.254 network 10.10.30.0 mask 255.255.255.0
quit
interface Tunnel0/0/1ip address 10.10.13.2 255.255.255.252 tunnel-protocol gresource 130.130.130.3destination 120.120.120.1
quit
ip route-static 10.10.10.0 255.255.255.0 Tunnel0/0/1
效果展示: