Manual 6in4 tunneling

This example creates an IPv6 6in4 tunnel, which allows IPv6 hosts in one network to exchange IPv6 data with hosts in another IPv6 network by using the IPv4 tunneling infrastructure. In this example:

  • All IPv6 traffic between hosts in the 3000::/64 and the 4000::/64 networks is tunneled through Switch B and Switch C, respectively.

  • Switch B and Switch C are the manually configured endpoints.

  • IPv6 traffic entering the tunnel endpoints is encapsulated with an IPv4 header based on the 6in4 configuration, and then routed through the IPv4 network using Switch A as the first hop.

  • Static IPv6 routes are used to route into the tunnel interfaces.

Manual 6in4 tunneling

Manual 6in4 tunneling

Configuring switch B

  1. Configure the Tunnel Endpoint for Switch B

    The tunnel endpoint for Switch B is configured with:

    • Mode—6in4

    • Source—encapsulation information for the IPv4 header indicating the source IPv4 address

    • Destination—encapsulation information for the IPv4 header indicating the destination IPv4 address

    • IPv6 Address—IPv6 network assigned to the interface (much like VLAN assignments). Enables IPv6 on the interface. It is required in order to route over the interface.

    Configuring a tunnel endpoint

    HP Switch(config)# interface tunnel 1
    HP Switch(tunnel-1)# tunnel mode 6in4
    HP Switch(tunnel-1)# tunnel source 20.0.0.1
    HP Switch(tunnel-1)# tunnel destination 30.0.0.1
    HP Switch(tunnel-1)# ipv6 address 5000::1/64
    

    5000::1/64

    IPv6 network assigned to the interface. Enables IPv6 on the interface.

  2. Configure VLAN 2 for the IPv6 Hosts on the 3000::/64 Network

    This step configures IPv6 address 3000::1/64 on VLAN 2. When IPv6 traffic from IPv6 host 3000::2/64 that is destined for the IPv6 4000::/64 network is transported over VLAN 2, it will be routed into the tunnel.

    The command is executed in VLAN context.

    Configuring the VLAN for routing traffic into the tunnel

    HP Switch(config)# vlan 2
    HP Switch(vlan-2)# ipv6 address 3000::1/64
    
  3. Configure IPv6 Routing to Route into the Tunnel

    IPv6 unicast routing is enabled. The static route is configured to route packets destined for the 4000::/64 network into the tunnel.

    Configuring IPv6 routing to route into tunnel

    HP Switch(config)# ipv6 unicast routing
    HP Switch(config)# ipv6 route 4000::/641
    
     5000::22
    
    
    

    1

    Configures static route for destinations in the 4000::/64 network

    2

    IPv6 address of tunnel endpoint

  4. Configure the VLAN Used to Reach the First Hop Router in the IPv4 Network

    This step configures the tunnel endpoint IPv4 address 20.0.0.1/24 (VLAN 1) in VLAN 2 context so that traffic from VLAN 2 can reach the first hop router in the IPv4 network through the tunnel.

    The command is performed in VLAN context.

    Configuring the IPv4 tunnel endpoint address

    HP Switch(vlan-2)# ip address 20.0.0.1/24
    
  5. Configure the IPv4 Default Gateway

    The IPv4 default gateway 20.0.0.2 is configured.

    Configuring the IPv4 gateway

    HP Switch(config)# ip default-gateway 20.0.0.2
    

Configure switch C

Configure sSwitch C in a manner similar to switch B, using the appropriate IPv6 and IPv4 addresses.

  1. Configure the Tunnel Endpoint for Switch C

    The tunnel endpoint for Switch C is configured with a mode, IPv4 source address, IPv4 destination address, and an IPv6 interface address.

    Configuring a tunnel endpoint (opposite end)

    HP Switch(config)# interface tunnel 1
    HP Switch(tunnel-1)# tunnel mode 6in4
    HP Switch(tunnel-1)# tunnel source 30.0.0.1
    HP Switch(tunnel-1)# tunnel destination 20.0.0.1
    HP Switch(tunnel-1)# ipv6 address 5000::2/64
    
  2. Configure VLAN 2 for the IPv6 Hosts on the 4000::/64 Network

    This step configures IPv6 address 4000::1/64 on VLAN 2. When IPv6 traffic from IPv6 host 4000::2/64 that is destined for the IPv6 3000::/64 network is transported over VLAN 2, it will be routed into the tunnel.

    This step is performed in VLAN context.

    Configuring the VLAN for routing traffic into the tunnel

    HP Switch(config)# vlan 2
    HP Switch(vlan-2)# ipv6 address 4000::1/64
    
  3. Configure IPv6 Routing to Route into the Tunnel

    IPv6 unicast routing is enabled. The static route is configured to route packets destined for the 3000::/64 network into the tunnel.

    Configuring IPv6 routing to route into tunnel

    HP Switch(config)# ipv6 unicast routing
    HP Switch(config)# ipv6 route 3000::/64 5000::1
    

    3000::/64

    Configures static route for destinations in the 3000::/64 network

    5000::1

    IPv6 address of tunnel endpoint

  4. Configure the VLAN Used to Reach the First Hop Router in the IPv4 Network

    This step configures the tunnel endpoint IPv4 address 30.0.0.1/24 (VLAN1) in VLAN 2 context so that traffic from VLAN 2 can reach the first hop router in the IPv4 network through the tunnel.

    The command is executed in VLAN context.

    Configuring the IPv4 tunnel endpoint address

    HP Switch(vlan-2)# ip address 30.0.0.1/24
    
  5. Configure the IPv4 Default Gateway

    The default gateway 30.0.0.2 is configured.

    Configuring the IPv4 default gateway

    HP Switch(config)# ip default-gateway 30.0.0.2