===== Cisco IOS L2TP =====
{{tag>Cisco IOS Routing}}
==== Description ====
The two PCs on subnet 10.1.1.0/24 can communicate with each over via layer 2. This is possible because of the L2TP configuration on the routers. The routers are not, and do not need to be, on the same layer 2 subnet as the PCs. The fourth router, R4, was added to demonstrate an alternative path that can be used via OSPF.
{{ :images:routing:cisco-ios-l2tp-01.png?nolink |}}
==== Configurations ====
=== PC 1 ===
PC1> show ip
NAME : PC1[1]
IP/MASK : 10.1.1.10/24
GATEWAY : 0.0.0.0
=== PC 2 ===
PC2> show ip
NAME : PC2[1]
IP/MASK : 10.1.1.20/24
GATEWAY : 0.0.0.0
=== Router R1 ===
!
pseudowire-class pctest1
encapsulation l2tpv3
protocol none
ip local interface FastEthernet1/0
!
pseudowire-class pctest2
encapsulation l2tpv3
protocol none
ip local interface FastEthernet2/0
!
interface Loopback1
ip address 172.31.0.1 255.255.255.255
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
no cdp enable
xconnect 192.168.21.3 2 encapsulation l2tpv3 manual pw-class pctest2
l2tp id 11 22
!
interface FastEthernet1/0
ip address 192.168.10.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet2/0
ip address 192.168.11.1 255.255.255.0
duplex auto
speed auto
!
router ospf 10
log-adjacency-changes
network 172.31.0.0 0.0.0.255 area 0
network 192.168.10.0 0.0.0.255 area 0
network 192.168.11.0 0.0.0.255 area 0
!
=== Router R3 ===
!
pseudowire-class pctest1
encapsulation l2tpv3
protocol none
ip local interface FastEthernet1/0
!
pseudowire-class pctest2
encapsulation l2tpv3
protocol none
ip local interface FastEthernet2/0
!
interface Loopback1
ip address 172.31.0.3 255.255.255.255
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
no cdp enable
xconnect 192.168.11.1 2 encapsulation l2tpv3 manual pw-class pctest2
l2tp id 22 11
!
interface FastEthernet1/0
ip address 192.168.20.3 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet2/0
ip address 192.168.21.3 255.255.255.0
duplex auto
speed auto
!
router ospf 10
log-adjacency-changes
network 172.31.0.0 0.0.0.255 area 0
network 192.168.20.0 0.0.0.255 area 0
network 192.168.21.0 0.0.0.255 area 0
!
=== Router R2 ===
!
interface Loopback1
ip address 172.31.0.2 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.10.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 192.168.20.2 255.255.255.0
duplex auto
speed auto
!
router ospf 10
log-adjacency-changes
network 172.31.0.0 0.0.0.255 area 0
network 192.168.10.0 0.0.0.255 area 0
network 192.168.20.0 0.0.0.255 area 0
!
=== Router R4 ===
!
interface Loopback1
ip address 172.31.0.4 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.11.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 192.168.21.2 255.255.255.0
duplex auto
speed auto
!
router ospf 10
log-adjacency-changes
network 172.31.0.0 0.0.0.255 area 0
network 192.168.11.0 0.0.0.255 area 0
network 192.168.21.0 0.0.0.255 area 0
!
==== Routing Tables ====
=== Router R1 ===
O 192.168.10.0/24 [110/11] via 192.168.20.2, 00:19:29, FastEthernet1/0
172.31.0.0/32 is subnetted, 4 subnets
C 172.31.0.3 is directly connected, Loopback1
O 172.31.0.2 [110/2] via 192.168.20.2, 00:19:29, FastEthernet1/0
O 172.31.0.1 [110/12] via 192.168.21.2, 00:19:29, FastEthernet2/0
[110/12] via 192.168.20.2, 00:19:29, FastEthernet1/0
O 172.31.0.4 [110/2] via 192.168.21.2, 00:19:29, FastEthernet2/0
O 192.168.11.0/24 [110/11] via 192.168.21.2, 00:19:30, FastEthernet2/0
C 192.168.21.0/24 is directly connected, FastEthernet2/0
C 192.168.20.0/24 is directly connected, FastEthernet1/0
=== Router R3 ===
O 192.168.10.0/24 [110/11] via 192.168.20.2, 00:19:29, FastEthernet1/0
172.31.0.0/32 is subnetted, 4 subnets
C 172.31.0.3 is directly connected, Loopback1
O 172.31.0.2 [110/2] via 192.168.20.2, 00:19:29, FastEthernet1/0
O 172.31.0.1 [110/12] via 192.168.21.2, 00:19:29, FastEthernet2/0
[110/12] via 192.168.20.2, 00:19:29, FastEthernet1/0
O 172.31.0.4 [110/2] via 192.168.21.2, 00:19:29, FastEthernet2/0
O 192.168.11.0/24 [110/11] via 192.168.21.2, 00:19:30, FastEthernet2/0
C 192.168.21.0/24 is directly connected, FastEthernet2/0
C 192.168.20.0/24 is directly connected, FastEthernet1/0
=== Router R2 ===
C 192.168.10.0/24 is directly connected, FastEthernet0/0
172.31.0.0/32 is subnetted, 4 subnets
O 172.31.0.3 [110/2] via 192.168.20.3, 00:18:57, FastEthernet1/0
C 172.31.0.2 is directly connected, Loopback1
O 172.31.0.1 [110/11] via 192.168.10.1, 00:18:57, FastEthernet0/0
O 172.31.0.4 [110/3] via 192.168.20.3, 00:18:57, FastEthernet1/0
O 192.168.11.0/24 [110/11] via 192.168.10.1, 00:18:57, FastEthernet0/0
O 192.168.21.0/24 [110/2] via 192.168.20.3, 00:18:57, FastEthernet1/0
C 192.168.20.0/24 is directly connected, FastEthernet1/0
=== Router R4 ===
O 192.168.10.0/24 [110/11] via 192.168.11.1, 00:18:19, FastEthernet0/0
172.31.0.0/32 is subnetted, 4 subnets
O 172.31.0.3 [110/2] via 192.168.21.3, 00:18:19, FastEthernet1/0
O 172.31.0.2 [110/3] via 192.168.21.3, 00:18:19, FastEthernet1/0
O 172.31.0.1 [110/11] via 192.168.11.1, 00:18:19, FastEthernet0/0
C 172.31.0.4 is directly connected, Loopback1
C 192.168.11.0/24 is directly connected, FastEthernet0/0
C 192.168.21.0/24 is directly connected, FastEthernet1/0
O 192.168.20.0/24 [110/2] via 192.168.21.3, 00:18:20, FastEthernet1/0