Example for Configuring an IPv4 over IPv6 Tunnel
Networking Requirements
In Figure 12-2, two IPv4 networks connect to an IPv6 network through RT1 and RT5. Border devices RT2 and RT4 on the IPv6 network support the IPv4/IPv6 dual stack. An IPv4 over IPv6 tunnel needs to be set up between RT2 and RT4 so that physically isolated IPv4 networks can communicate.
Configuration Roadmap
The configuration roadmap is as follows:
Configure an IPv4 over IPv6 tunnel on the border devices at both ends of the IPv6 network.
Use a dynamic routing protocol to configure a route for the tunnel interface to forward packets.
Procedure
- Configure an IPv6 address for the physical interface and enable IPv6 capability for IS-IS on the IPv6 network to implement IP connectivity of the IPv6 network.
# Configure RT2.
<Huawei> system-view [Huawei] sysname RT2 [RT2] ipv6 [RT2] interface gigabitethernet 2/0/0 [RT2-GigabitEthernet2/0/0] ipv6 enable [RT2-GigabitEthernet2/0/0] ipv6 address fc00:1::1 64 [RT2-GigabitEthernet2/0/0] quit [RT2] isis 1 [RT2-isis-1] network-entity 10.0000.0000.0001.00 [RT2-isis-1] ipv6 enable topology standard [RT2-isis-1] quit [RT2] interface gigabitethernet 2/0/0 [RT2-GigabitEthernet2/0/0] isis ipv6 enable 1 [RT2-GigabitEthernet2/0/0] quit
# Configure RT3.
<Huawei> system-view [Huawei] sysname RT3 [RT3] ipv6 [RT3] interface gigabitethernet 1/0/0 [RT3-GigabitEthernet1/0/0] ipv6 enable [RT3-GigabitEthernet1/0/0] ipv6 address fc00:1::2 64 [RT3-GigabitEthernet1/0/0] quit [RT3] interface gigabitethernet 2/0/0 [RT3-GigabitEthernet2/0/0] ipv6 enable [RT3-GigabitEthernet2/0/0] ipv6 address fc00:2::1 64 [RT3-GigabitEthernet2/0/0] quit [RT3] isis 1 [RT3-isis-1] network-entity 10.0000.0000.0002.00 [RT3-isis-1] ipv6 enable topology standard [RT3-isis-1] quit [RT3] interface gigabitethernet 1/0/0 [RT3-GigabitEthernet1/0/0] isis ipv6 enable 1 [RT3-GigabitEthernet1/0/0] quit [RT3] interface gigabitethernet 2/0/0 [RT3-GigabitEthernet2/0/0] isis ipv6 enable 1 [RT3-GigabitEthernet2/0/0] quit
# Configure RT4.
<Huawei> system-view [Huawei] sysname RT4 [RT4] ipv6 [RT4] interface gigabitethernet 1/0/0 [RT4-GigabitEthernet1/0/0] ipv6 enable [RT4-GigabitEthernet1/0/0] ipv6 address fc00:2::2 64 [RT4-GigabitEthernet1/0/0] quit [RT4] isis 1 [RT4-isis-1] network-entity 10.0000.0000.0003.00 [RT4-isis-1] ipv6 enable topology standard [RT4-isis-1] quit [RT4] interface gigabitethernet 1/0/0 [RT4-GigabitEthernet1/0/0] isis ipv6 enable 1 [RT4-GigabitEthernet1/0/0] quit
- Configure an IPv4 address for the physical interface and configure OSPF on the IPv4 network to implement IP connectivity of the IPv4 network.
# Configure RT1.
<Huawei> system-view [Huawei] sysname RT1 [RT1] interface gigabitethernet 1/0/0 [RT1-GigabitEthernet1/0/0] ip address 10.1.2.2 30 [RT1-GigabitEthernet1/0/0] quit [RT1] ospf 1 [RT1-ospf-1] area 0 [RT1-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.3
# Configure RT2.
[RT2] interface gigabitethernet 1/0/0 [RT2-GigabitEthernet1/0/0] ip address 10.1.2.1 30 [RT2-GigabitEthernet1/0/0] quit [RT2] ospf 1 [RT2-ospf-1] area 0 [RT2-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.3
# Configure RT4.
[RT4] interface gigabitethernet 2/0/0 [RT4-GigabitEthernet2/0/0] ip address 10.1.3.1 30 [RT4-GigabitEthernet2/0/0] quit [RT4] ospf 1 [RT4-ospf-1] area 0 [RT4-ospf-1-area-0.0.0.0] network 10.1.3.0 0.0.0.3
# Configure RT5.
<Huawei> system-view [Huawei] sysname RT5 [RT5] interface gigabitethernet 1/0/0 [RT5-GigabitEthernet1/0/0] ip address 10.1.3.2 30 [RT5-GigabitEthernet1/0/0] quit [RT5] ospf 1 [RT5-ospf-1] area 0 [RT5-ospf-1-area-0.0.0.0] network 10.1.3.0 0.0.0.3
- Configure a tunnel interface.
# Create a tunnel interface, and configure an IPv4 address, a source IPv6 address (or source interface), and a destination IPv6 address for the tunnel interface.
# Configure RT2.
[RT2] interface tunnel 0/0/2 [RT2-Tunnel0/0/2] tunnel-protocol ipv4-ipv6 [RT2-Tunnel0/0/2] undo tunnel ipv4-ipv6 encapsulation-limit [RT2-Tunnel0/0/2] ip address 10.1.1.1 30 [RT2-Tunnel0/0/2] source gigabitethernet 2/0/0 [ET2-Tunnel0/0/2] destination fc00:2::2
# Configure RT4.
[RT4] interface tunnel 0/0/1 [RT4-Tunnel0/0/1] tunnel-protocol ipv4-ipv6 [RT4-Tunnel0/0/1] undo tunnel ipv4-ipv6 encapsulation-limit [RT4-Tunnel0/0/1] ip address 10.1.1.2 30 [RT4-Tunnel0/0/1] source gigabitethernet 1/0/0 [ET4-Tunnel0/0/1] destination fc00:1::1
- Use a dynamic routing protocol to configure a route for the tunnel interface to forward packets.
# Configure RT2.
[RT2] ospf 1 [RT2-ospf-1] area 0 [RT2-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.3 [RT2-ospf-1-area-0.0.0.0] quit [RT2-ospf-1] quit
# Configure RT4.
[RT4] ospf 1 [RT4-ospf-1] area 0 [RT4-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.3
- Verify the configuration.
# After the preceding configurations are complete, check the tunnel interface status on RT2 and RT4. You can see that the protocol status of the tunnel interface is Up.
[RT2] display interface tunnel 0/0/2 Tunnel0/0/2 current state : UP Line protocol current state : UP Last line protocol up time: 2010-06-22, 19:33:19 Description : HUAWEI, AR Series, Tunnel0/0/2 Interface Route Port,The Maximum Transmit Unit is 1500 Internet Address is 10.1.1.1/30 Encapsulation is TUNNEL6, loopback not set Tunnel protocol/transport (IPv6 or IPv4) over IPv6 Tunnel Source fc00:1::1 (GigabitEthernet2/0/0) Tunnel Destination fc00:2::2 Tunnel Encapsulation limit 4 Tunnel Traffic class not set Tunnel Flow label not set Tunnel Hop limit 64 Current system time: 2012-09-05 10:28:33 300 seconds input rate 0 bits/sec, 0 packets/sec 300 seconds output rate 0 bits/sec, 0 packets/sec 102 seconds input rate 0 bits/sec, 0 packets/sec 102 seconds output rate 0 bits/sec, 0 packets/sec 0 packets input, 0 bytes 0 input error 0 packets output, 0 bytes 0 output error Input bandwidth utilization : -- Output bandwidth utilization : --
# Check the IPv4 routing table on RT2 and RT4. You can see that the outbound interface of the route to the remote IPv4 network is a tunnel interface.
[RT2] display ip routing-table Routing Tables: Public Destinations : 9 Routes : 9 Destination/Mask Proto Pre Cost NextHop Interface 1.1.1.1/32 Direct 0 0 127.0.0.1 InLoopBack0 10.1.1.0/30 Direct 0 0 10.1.1.1 Tunnel0/0/2 10.1.1.1/32 Direct 0 0 127.0.0.1 Tunnel2/0/0 10.1.2.0/30 Direct 0 0 10.1.2.1 GigabitEthernet1/0/0 10.1.2.1/32 Direct 0 0 127.0.0.1 GigabitEthernet1/0/0 10.1.2.2/32 Direct 0 0 10.1.2.2 GigabitEthernet1/0/0 10.1.3.0/24 OSPF 10 2 10.1.1.2 Tunnel0/0/2 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoopBack0
# RT1 and RT5 can ping each other.
Configuration Files
Configuration file of RT1
# sysname RT1 # interface GigabitEthernet1/0/0 ip address 10.1.2.2 255.255.255.252 # ospf 1 area 0.0.0.0 network 10.1.2.0 0.0.0.3 # return
Configuration file of RT2
# sysname RT2 # ipv6 # isis 1 network-entity 10.0000.0000.0001.00 # ipv6 enable topology standard # # interface GigabitEthernet1/0/0 ip address 10.1.2.1 255.255.255.252 # interface GigabitEthernet2/0/0 ipv6 enable ipv6 address fc00:1::1/64 isis ipv6 enable 1 # interface Tunnel0/0/2 ip address 10.1.1.1 255.255.255.252 tunnel-protocol ipv4-ipv6 undo tunnel ipv4-ipv6 encapsulation-limit source GigabitEthernet2/0/0 destination fc00:2::2 # ospf 1 area 0.0.0.0 network 10.1.2.0 0.0.0.3 network 10.1.1.0 0.0.0.3 # return
Configuration file of RT3
# sysname RT3 # ipv6 # isis 1 network-entity 10.0000.0000.0002.00 # ipv6 enable topology standard # # interface GigabitEthernet1/0/0 ivp6 enable ipv6 address fc00:1::2/64 isis ipv6 enable 1 # interface GigabitEthernet2/0/0 ipv6 enable ipv6 address fc00:2::1/64 isis ipv6 enable 1 # return
Configuration file of RT4
# sysname RT4 # ipv6 # isis 1 network-entity 10.0000.0000.0003.00 # ipv6 enable topology standard # # interface GigabitEthernet1/0/0 ipv6 enable ipv6 address fc00:2::2/64 isis ipv6 enable 1 # interface GigabitEthernet2/0/0 ip address 10.1.3.1 255.255.255.252 # interface Tunnel0/0/1 ip address 10.1.1.2 255.255.255.252 tunnel-protocol ipv4-ipv6 undo tunnel ipv4-ipv6 encapsulation-limit source GigabitEthernet1/0/0 destination fc00:1::1 # ospf 1 area 0.0.0.0 network 10.1.1.0 0.0.0.3 network 10.1.3.0 0.0.0.3 # return
Configuration file of RT5
# sysname RT1 # interface GigabitEthernet1/0/0 ip address 10.1.3.2 255.255.255.252 # ospf 1 area 0.0.0.0 network 10.1.3.0 0.0.0.3 # return