Example: Tunneling using Policy-Based Routing (PBR)

The following example uses the configuration shown in Configuring the IPv4 default gateway. The routing configuration uses PBR to route into the tunnel. The configuration steps are similar to the prior example, with the addition of the PBR configuration.

Configure switch B

  1. Configure the Tunnel Endpoint for Switch B

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

    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
    
  2. Configure VLAN 2 for the IPv6 Hosts on the 3000::/64 Network

    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 3000::1/64
    
  3. Configure the VLAN Used to Reach the First Hop Router in the IPv4 Network

    This command is performed in VLAN context.

    Configuring the IPv4 tunnel endpoint address

    HP Switch(vlan-2)# ip address 20.0.0.1/24
    
  4. Configure the IPv4 Default Gateway and Enable Unicast Routing

    Configuring the IPv4 default gateway and enabling unicast routing

    HP Switch(config)# ip default-gateway 20.0.0.2
    HP Switch(config)# ipv6 unicast routing
    
  5. Configure IPv6 PBR-Based Routing

    Execute these steps to configure the IPv6 PBR-based routing to route into the tunnel, and apply it to the inbound VLAN.

    Configuring IPv6 PBR-based routing

    HP Switch(config)# class ipv6 PBR_Class
    HP Switch(config-class)# match ipv6 any 4000::/64
    HP Switch(config-class)# exit
    
    HP Switch(config)# policy pbr PBR_Policy
    HP Switch(policy-pbr)# class ipv6 PBR_Class
    HP Switch(policy-pbr)# action interface tunnel 1
    HP Switch(policy-pbr)# exit
    
    HP Switch(config)# vlan 2
    HP Switch(vlan-2)# service-policy PBR_Policy in
    

Configure switch C

  1. Configure the Tunnel Endpoint for Switch C

    The tunnel endpoint for Switch C is configured with a mode, source and destination, and an IPv6 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 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 the VLAN Used to Reach the First Hop Router in the IPv4 Network

    This step is performed in VLAN context.

    Configuring the IPv4 tunnel endpoint address

    HP Switch(vlan-2)# ip address 30.0.0.1/24
    
  4. Configure the IPv4 Default Gateway and Enable Unicast Routing

    Configuring the IPv4 default gateway and configuring unicast routing

    HP Switch(config)# ip default-gateway 30.0.0.2
    HP Switch(config)# ipv6 unicast routing
    
  5. Configure IPv6 PBR-Based Routing

    Execute these steps to configure the IPv6 PBR-based routing to route into the tunnel, and apply it to the inbound VLAN.

    Configuring IPv6 PBR-based routing

    HP Switch(config)# class ipv6 PBR_Class
    HP Switch(config-class)# match ipv6 any 3000::/64
    HP Switch(config-class)# exit
    
    HP Switch(config)# policy pbr PBR_Policy
    HP Switch(policy-pbr)# class ipv6 PBR_Class
    HP Switch(policy-pbr)# action interface tunnel 1
    HP Switch(policy-pbr)# exit
    
    HP Switch(config)# vlan 2
    HP Switch(vlan-2)# service-policy PBR_Policy in