Creating an IPv6 in IPv4 tunnel for traversing a public network

This example creates an IPv6 in IPv4 tunnel between two switches, enabling traffic from two networks to traverse a public network.

Procedure

  1. 在开关1:
    1. Enable interface1/1/1and assign the IP address10.1.1.1/24to it.

      switch#config

      switch(config)#interface 1/1/1

      switch(config-if)#ip address 10.1.1.1/24

      switch(config-if)#no shutdown

    2. Enable interface1/1/2and assign the IP address2080::2/64to it.

      switch#config

      switch(config)#interface 1/1/2

      switch(config-if)#ipv6地址2080::2/64

      switch(config-if)#no shutdown

      switch(config-if)#exit

    3. Create IPv6 in IPv4 tunnel10and assign the IP address2001:DB8::1/32, source address10.1.1.1, and destination address20.1.1.1to it.

      switch(config)#interface tunnel 10 mode ip 6in4

      switch(config-ip-if)#ipv6 address 2001:DB8::1/62

      switch(config-ip-if)#source ip 10.1.1.1

      switch(config-ip-if)#destination ip 20.1.1.1

      switch(config-ip-if)#no shutdown

      switch(config-ip-if)#exit

    4. 定义了路线s so that traffic from network 1 can reach network 2 through the tunnel.

      switch(config)#ip route 20.1.1.0/24 10.1.1.2switch(config)#ipv6 route 290::0/64 tunnel10

  2. On switch 2:
    1. Enable interface1/1/1and assign the IP address20.1.1.1/24to it.

      switch#config

      switch(config)#interface 1/1/1

      switch(config-if)#ip address 20.1.1.1/24

      switch(config-if)#no shutdown

    2. Enable interface1/1/2and assign the IP address2090::2/64to it.

      switch(config)#interface 1/1/2

      switch(config-if)#ipv6 address2090::2/64

      switch(config-if)#no shutdown

      switch(config-if)#exit

    3. Create IPv6 in IPv4 tunnel10and assign the IP address2001:DB8::2/32, source address10.1.1.1, and destination address20.1.1.1to it.

      switch(config)#interface tunnel 10 mode ip 6in4

      switch(config-ip-if)#ipv6 address 2001:DB8::2/62

      switch(config-ip-if)#source ip 20.1.1.1

      switch(config-ip-if)#destination ip 10.1.1.1

      switch(config-ip-if)#no shutdown

      switch(config-ip-if)#exit

    4. 定义了路线s so that traffic from network 2 can reach network 1 through the tunnel.

      switch(config)#ip route 10.1.1.0/24 20.1.1.2

      switch(config)#ip route 2080::0/64 tunnel10