Configuring switch B for PBR-based routing

Procedure
  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.

    Switch(config)# interface tunnel 1
    Switch(tunnel-1)# tunnel mode 6in4
    Switch(tunnel-1)# tunnel source 20.0.0.1
    Switch(tunnel-1)# tunnel destination 30.0.0.1
    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.

    Switch(config)# vlan 2
    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.

    Switch(vlan-2)# ip address 20.0.0.1/24
  4. Configure the IPv4 Default Gateway and Enable Unicast Routing
    Switch(config)# ip default-gateway 20.0.0.2
    Switch(config)# ipv6 unicast routing
  5. Configure IPv6 PBR-Based Routing

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

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