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
-
On switch 1:
- Enable interface
1/1/1 and assign the IP address
10.1.1.1/24 to it.
switch# config switch(config)# interface 1/1/1 switch(config-if)# ip address 10.1.1.1/24 switch(config-if)# no shutdown
- Enable interface
1/1/2 and assign the IP address
2080::2/64 to it.
switch# config switch(config)# interface 1/1/2 switch(config-if)# ipv6 address 2080::2/64 switch(config-if)# no shutdown switch(config-if)# exit
- Create IPv6 in IPv4 tunnel
10 and assign the IP address
2001:DB8::1/32, source address
10.1.1.1, and destination address
20.1.1.1 to 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
- Defines routes 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.2 switch(config)# ipv6 route 290::0/64 tunnel10
- Enable interface
1/1/1 and assign the IP address
10.1.1.1/24 to it.
-
On switch 2:
- Enable interface
1/1/1 and assign the IP address
20.1.1.1/24 to it.
switch# config switch(config)# interface 1/1/1 switch(config-if)# ip address 20.1.1.1/24 switch(config-if)# no shutdown
- Enable interface
1/1/2 and assign the IP address
2090::2/64 to it.
switch(config)# interface 1/1/2 switch(config-if)# ipv6 address 2090::2/64 switch(config-if)# no shutdown switch(config-if)# exit
- Create IPv6 in IPv4 tunnel
10 and assign the IP address
2001:DB8::2/32, source address
10.1.1.1, and destination address
20.1.1.1 to 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
- Defines routes 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
- Enable interface
1/1/1 and assign the IP address
20.1.1.1/24 to it.