In Figure 1, two IPv4 networks connect to an IPv6 network through SwitchA and SwitchE. Border devices SwitchB and SwitchD on the IPv6 network support the IPv4/IPv6 dual stack. An IPv4 over IPv6 tunnel needs to be set up between SwitchB and SwitchD so that physically isolated IPv4 networks can communicate.
The configuration roadmap is as follows:
Configure the IPv6 network. Configure IPv6 addresses and routes for interfaces so that SwitchB, SwitchC, and SwitchD can communicate with each other.
Configure the IPv4 networks. Configure IPv4 addresses and routes for interfaces so that SwitchB and SwitchD can access the IPv4 networks.
Configure tunnel interfaces. Configure IPv4 addresses, protocol types, source interfaces, and destination addresses for tunnel interfaces so that IPv4 packets can be forwarded on the IPv6 network.
Configure a static route for forwarding IPv4 packets to the IPv4 over IPv6 tunnel.
# Configure SwitchB.
<HUAWEI> system-view [HUAWEI] sysname SwitchB [SwitchB] ipv6 [SwitchB] vlan batch 100 200 [SwitchB] interface gigabitethernet 0/0/2 [SwitchB-GigabitEthernet0/0/2] port link-type hybrid [SwitchB-GigabitEthernet0/0/2] port hybrid pvid vlan 200 [SwitchB-GigabitEthernet0/0/2] port hybrid untagged vlan 200 [SwitchB-GigabitEthernet0/0/2] quit [SwitchB] interface vlanif 200 [SwitchB-Vlanif200] ipv6 enable [SwitchB-Vlanif200] ipv6 address fc00:1::1 64 [SwitchB-Vlanif200] quit [SwitchB] isis 1 [SwitchB-isis-1] network-entity 10.0000.0000.0001.00 [SwitchB-isis-1] ipv6 enable topology standard [SwitchB-isis-1] quit [SwitchB] interface vlanif 200 [SwitchB-Vlanif200] isis ipv6 enable 1 [SwitchB-Vlanif200] quit
# Configure SwitchC.
<HUAWEI> system-view [HUAWEI] sysname SwitchC [SwitchC] ipv6 [SwitchC] vlan batch 100 200 [SwitchC] interface gigabitethernet 0/0/1 [SwitchC-GigabitEthernet0/0/1] port link-type hybrid [SwitchC-GigabitEthernet0/0/1] port hybrid pvid vlan 200 [SwitchC-GigabitEthernet0/0/1] port hybrid untagged vlan 200 [SwitchC-GigabitEthernet0/0/1] quit [SwitchC] interface gigabitethernet 0/0/2 [SwitchC-GigabitEthernet0/0/2] port link-type hybrid [SwitchC-GigabitEthernet0/0/2] port hybrid pvid vlan 100 [SwitchC-GigabitEthernet0/0/2] port hybrid untagged vlan 100 [SwitchC-GigabitEthernet0/0/2] quit [SwitchC] interface vlanif 200 [SwitchC-Vlanif200] ipv6 enable [SwitchC-Vlanif200] ipv6 address fc00:1::2 64 [SwitchC-Vlanif200] quit [SwitchC] interface vlanif 100 [SwitchC-Vlanif100] ipv6 enable [SwitchC-Vlanif100] ipv6 address fc00:2::1 64 [SwitchC-Vlanif100] quit [SwitchC] isis 1 [SwitchC-isis-1] network-entity 10.0000.0000.0002.00 [SwitchC-isis-1] ipv6 enable topology standard [SwitchC-isis-1] quit [SwitchC] interface vlanif 100 [SwitchC-Vlanif100] isis ipv6 enable 1 [SwitchC-Vlanif100] quit [SwitchC] interface vlanif 200 [SwitchC-Vlanif200] isis ipv6 enable 1 [SwitchC-Vlanif200] quit
# Configure SwitchD.
<HUAWEI> system-view [HUAWEI] sysname SwitchD [SwitchD] ipv6 [SwitchD] vlan batch 100 200 [SwitchD] interface gigabitethernet 0/0/1 [SwitchD-GigabitEthernet0/0/1] port link-type hybrid [SwitchD-GigabitEthernet0/0/1] port hybrid pvid vlan 100 [SwitchD-GigabitEthernet0/0/1] port hybrid untagged vlan 100 [SwitchD-GigabitEthernet0/0/1] quit [SwitchD] interface vlanif 100 [SwitchD-Vlanif100] ipv6 enable [SwitchD-Vlanif100] ipv6 address fc00:2::2 64 [SwitchD-Vlanif100] quit [SwitchD] isis 1 [SwitchD-isis-1] network-entity 10.0000.0000.0003.00 [SwitchD-isis-1] ipv6 enable topology standard [SwitchD-isis-1] quit [SwitchD] interface vlanif 100 [SwitchD-Vlanif100] isis ipv6 enable 1 [SwitchD-Vlanif100] quit
# Configure SwitchA.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 100 [SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] port link-type hybrid [SwitchA-GigabitEthernet0/0/1] port hybrid pvid vlan 100 [SwitchA-GigabitEthernet0/0/1] port hybrid untagged vlan 100 [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] interface vlanif 100 [SwitchA-Vlanif100] ip address 10.1.2.2 30 [SwitchA-Vlanif100] quit [SwitchA] ospf 1 [SwitchA-ospf-1] area 0 [SwitchA-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.3 [SwitchA-ospf-1-area-0.0.0.0] quit [SwitchA-ospf-1] quit [SwitchA] ip route-static 10.1.3.2 255.255.255.252 vlanif 100 10.1.2.1
# Configure SwitchB.
[SwitchB] interface gigabitethernet 0/0/1 [SwitchB-GigabitEthernet0/0/1] port link-type hybrid [SwitchB-GigabitEthernet0/0/1] port hybrid pvid vlan 100 [SwitchB-GigabitEthernet0/0/1] port hybrid untagged vlan 100 [SwitchB-GigabitEthernet0/0/1] quit [SwitchB] interface vlanif 100 [SwitchB-Vlanif100] ip address 10.1.2.1 30 [SwitchB-Vlanif100] quit [SwitchB] ospf 1 [SwitchB-ospf-1] area 0 [SwitchB-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.3 [SwitchB-ospf-1-area-0.0.0.0] quit [SwitchB-ospf-1] quit
# Configure SwitchD.
[SwitchD] interface gigabitethernet 0/0/2 [SwitchD-GigabitEthernet0/0/2] port link-type hybrid [SwitchD-GigabitEthernet0/0/2] port hybrid pvid vlan 200 [SwitchD-GigabitEthernet0/0/2] port hybrid untagged vlan 200 [SwitchD-GigabitEthernet0/0/2] quit [SwitchD] interface vlanif 200 [SwitchD-Vlanif200] ip address 10.1.3.1 30 [SwitchD-Vlanif200] quit [SwitchD] ospf 1 [SwitchD-ospf-1] area 0 [SwitchD-ospf-1-area-0.0.0.0] network 10.1.3.0 0.0.0.3 [SwitchD-ospf-1-area-0.0.0.0] quit [SwitchD-ospf-1] quit
# Configure SwitchE.
<HUAWEI> system-view [HUAWEI] sysname SwitchE [SwitchE] vlan batch 200 [SwitchE] interface gigabitethernet 0/0/1 [SwitchE-GigabitEthernet0/0/1] port link-type hybrid [SwitchE-GigabitEthernet0/0/1] port hybrid pvid vlan 200 [SwitchE-GigabitEthernet0/0/1] port hybrid untagged vlan 200 [SwitchE-GigabitEthernet0/0/1] quit [SwitchE] interface vlanif 200 [SwitchE-Vlanif200] ip address 10.1.3.2 30 [SwitchE-Vlanif200] quit [SwitchE] ospf 1 [SwitchE-ospf-1] area 0 [SwitchE-ospf-1-area-0.0.0.0] network 10.1.3.0 0.0.0.3 [SwitchE-ospf-1-area-0.0.0.0] quit [SwitchE-ospf-1] quit [SwitchE] ip route-static 10.1.2.2 255.255.255.252 vlanif 200 10.1.3.1
The interface must be idle and not transmitting services.
After the service loopback function is enabled on the Eth-Trunk, the physical interfaces added to the Eth-Trunk must be in the Up state. Otherwise, the link layer protocol of the tunnel interface cannot run properly.
# Configure SwitchB.
[SwitchB] interface eth-trunk 1 [SwitchB-Eth-Trunk1] service type tunnel [SwitchB-Eth-Trunk1] quit [SwitchB] interface gigabitethernet 0/0/3 [SwitchB-GigabitEthernet0/0/3] eth-trunk 1 [SwitchB-GigabitEthernet0/0/3] quit
# Configure SwitchD.
[SwitchD] interface eth-trunk 1 [SwitchD-Eth-Trunk1] service type tunnel [SwitchD-Eth-Trunk1] quit [SwitchD] interface gigabitethernet 0/0/3 [SwitchD-GigabitEthernet0/0/3] eth-trunk 1 [SwitchD-GigabitEthernet0/0/3] quit
# Configure SwitchB.
[SwitchB] interface tunnel 2 [SwitchB-Tunnel2] tunnel-protocol ipv4-ipv6 [SwitchB-Tunnel2] ip address 10.1.1.1 30 [SwitchB-Tunnel2] eth-trunk 1 [SwitchB-Tunnel2] source vlanif 200 [SwitchB-Tunnel2] destination fc00:2::2 [SwitchB-Tunnel2] quit
# Configure SwitchD.
[SwitchD] interface tunnel 1 [SwitchD-Tunnel1] tunnel-protocol ipv4-ipv6 [SwitchD-Tunnel1] ip address 10.1.1.2 30 [SwitchD-Tunnel1] eth-trunk 1 [SwitchD-Tunnel1] source vlanif 100 [SwitchD-Tunnel1] destination fc00:1::1 [SwitchD-Tunnel1] quit
# Configure SwitchB.
[SwitchB] ip route-static 10.1.3.2 255.255.255.252 tunnel 2
# Configure SwitchD.
[SwitchD] ip route-static 10.1.2.2 255.255.255.252 tunnel 1
After the preceding configurations are complete, check the status of the tunnel interface on SwitchB and SwitchD. You can see that the protocol status of the tunnel interface is Up.
[SwitchB] display interface tunnel 2 Tunnel2 current state : UP Line protocol current state : UP Last line protocol up time : 2014-12-24 17:03:42 Description: 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 (Vlanif200) 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: 2014-12-24 17:04:18 Input bandwidth utilization : 0% Output bandwidth utilization : 0%
Ping VLANIF200 on SwitchE from SwitchA. You can see that SwitchA can receive Reply packets from SwitchE.
[SwitchA] ping 10.1.3.2 PING 10.1.3.2: 56 data bytes, press CTRL_C to break Reply from 10.1.3.2: bytes=56 Sequence=1 ttl=254 time=20 ms Reply from 10.1.3.2: bytes=56 Sequence=2 ttl=254 time=1 ms Reply from 10.1.3.2: bytes=56 Sequence=3 ttl=254 time=1 ms Reply from 10.1.3.2: bytes=56 Sequence=4 ttl=254 time=1 ms Reply from 10.1.3.2: bytes=56 Sequence=5 ttl=254 time=1 ms --- 10.1.3.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 1/4/20 ms
SwitchA configuration file
# sysname SwitchA # vlan batch 100 # interface Vlanif100 ip address 10.1.2.2 255.255.255.252 # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 100 port hybrid untagged vlan 100 # ospf 1 area 0.0.0.0 network 10.1.2.0 0.0.0.3 # ip route-static 10.1.3.0 255.255.255.252 Vlanif100 10.1.2.1 # return
SwitchB configuration file
# sysname SwitchB # ipv6 # vlan batch 100 200 # isis 1 network-entity 10.0000.0000.0001.00 # ipv6 enable topology standard # # interface Vlanif100 ip address 10.1.2.1 255.255.255.252 # interface Vlanif200 ipv6 enable ipv6 address FC00:1::1/64 isis ipv6 enable 1 # interface Eth-Trunk1 service type tunnel # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 100 port hybrid untagged vlan 100 # interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 200 port hybrid untagged vlan 200 # interface GigabitEthernet0/0/3 eth-trunk 1 # interface Tunnel2 ip address 10.1.1.1 255.255.255.252 tunnel-protocol ipv4-ipv6 source Vlanif200 destination FC00:2::2 eth-trunk 1 # ospf 1 area 0.0.0.0 network 10.1.2.0 0.0.0.3 # ip route-static 10.1.3.0 255.255.255.252 Tunnel2 # return
SwitchC configuration file
# sysname SwitchC # ipv6 # vlan batch 100 200 # isis 1 network-entity 10.0000.0000.0002.00 # ipv6 enable topology standard # # interface Vlanif100 ipv6 enable ipv6 address FC00:2::1/64 isis ipv6 enable 1 # interface Vlanif200 ipv6 enable ipv6 address FC00:1::2/64 isis ipv6 enable 1 # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 200 port hybrid untagged vlan 200 # interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 100 port hybrid untagged vlan 100 # return
SwitchD configuration file
# sysname SwitchD # ipv6 # vlan batch 100 200 # isis 1 network-entity 10.0000.0000.0003.00 # ipv6 enable topology standard # # interface Vlanif100 ipv6 enable ipv6 address FC00:2::2/64 isis ipv6 enable 1 # interface Vlanif200 ip address 10.1.3.1 255.255.255.252 # interface Eth-Trunk1 service type tunnel # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 100 port hybrid untagged vlan 100 # interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 200 port hybrid untagged vlan 200 # interface GigabitEthernet0/0/3 eth-trunk 1 # interface Tunnel1 ip address 10.1.1.2 255.255.255.252 tunnel-protocol ipv4-ipv6 source Vlanif100 destination FC00:1::1 eth-trunk 1 # ospf 1 area 0.0.0.0 network 10.1.3.0 0.0.0.3 # ip route-static 10.1.2.0 255.255.255.252 Tunnel1 # return
SwitchE configuration file
# sysname SwitchE # vlan batch 200 # interface Vlanif200 ip address 10.1.3.2 255.255.255.252 # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 200 port hybrid untagged vlan 200 # ospf 1 area 0.0.0.0 network 10.1.3.0 0.0.0.3 # ip route-static 10.1.2.0 255.255.255.252 Vlanif200 10.1.3.1 # return