An L2TPv3 tunnel supports multiple types of service access modes.
An L2TPv3 tunnel supports the following service access modes: whole-interface mode, C-tag termination mode, S-tag termination mode, and S-tag+C-tag termination mode. The L2TPv3 tunnel configurations for different service access modes are similar.
Device |
Interface |
IP Address |
---|---|---|
CE1 |
GE0/1/1 |
- |
CE2 |
GE0/1/1 |
- |
CE3 |
GE0/1/1 |
- |
PE1 |
GE0/1/1.4 |
- |
GE0/1/25.4 |
- |
|
Loopback 2 |
2001:db08:1::1 |
|
Loopback 3 |
2001:db08:1::2 |
|
GE0/1/17 |
2001:db08:2::2 |
|
GE0/1/9 |
2001:db08:2::1 |
|
PE2 |
Loopback 4 |
2001:db08:4::1 |
GE0/1/9 |
2001:db08:3::1 |
|
GE0/1/1.4 |
- |
|
PE3 |
Loopback 5 |
2001:db08:4::2 |
GE0/1/9 |
2001:db08:3::2 |
|
GE0/1/1.4 |
- |
The configuration roadmap is as follows:
Configure IS-IS routes on PEs.
Configure the VLAN service on each CE.
Enable L2TPv3 on each PE.
Establish an L2TPv3 tunnel between PE1 and PE2, and between PE1 and PE3. Then, configure the source and destination addresses, cookies, and L2TPv3 instances for the two tunnels.
Configure services on PE1, PE2, and PE3 to access L2TPv3 tunnels.
To complete the configuration, you need the following data:
Source interfaces, source and destination addresses, and IP addresses of directly connected interfaces between PEs
Cookie values for L2TPv3 tunnels
Service access modes for L2TPv3 tunnels
IDs of L2TPv3 instances to be bound to L2TPv3 tunnels
<HUAWEI> system-view [~HUAWEI] sysname PE1 [*HUAWEI] commit [*PE1] isis 1 [*PE1-isis-1] cost-style wide [*PE1-isis-1] network-entity 10.0000.0000.0002.00 [*PE1-isis-1] ipv6 enable topology compatible [*PE1-isis-1] quit [*PE1] interface loopback2 [*PE1-loopback2] ipv6 enable [*PE1-loopback2] isis ipv6 enable 1 [*PE1-loopback2] ipv6 address 2001:DB08:1::1 128 [*PE1-loopback2] quit [*PE1] interface gigabitethernet0/1/9 [*PE1-Gigabitethernet0/1/9] ipv6 enable [*PE1-Gigabitethernet0/1/9] isis ipv6 enable 1 [*PE1-Gigabitethernet0/1/9] ipv6 address 2001:db08:2::1 64 [*PE1-Gigabitethernet0/1/9] quit [*PE1] interface loopback3 [*PE1-loopback3] ipv6 enable [*PE1-loopback3] isis ipv6 enable 1 [*PE1-loopback3] ipv6 address 2001:DB08:1::2 128 [*PE1-loopback3] quit [*PE1] interface gigabitethernet0/1/17 [*PE1-Gigabitethernet0/1/17] ipv6 enable [*PE1-Gigabitethernet0/1/17] isis ipv6 enable 1 [*PE1-Gigabitethernet0/1/17] ipv6 address 2001:db08:2::2 64 [*PE1-Gigabitethernet0/1/17] commit [*PE1-Gigabitethernet0/1/17] quit
<HUAWEI> system-view [~HUAWEI] sysname PE2 [*HUAWEI] commit [*PE2] isis 1 [*PE2-isis-1] cost-style wide [*PE2-isis-1] network-entity 10.0000.0000.0003.00 [*PE2-isis-1] ipv6 enable topology compatible [*PE2-isis-1] quit [*PE2] interface loopback4 [*PE2-loopback4] ipv6 enable [*PE2-loopback4] isis ipv6 enable 1 [*PE2-loopback4] ipv6 address 2001:DB08:4::1 128 [*PE2-loopback4] quit [*PE2] interface gigabitethernet0/1/9 [*PE2-Gigabitethernet0/1/9] ipv6 enable [*PE2-Gigabitethernet0/1/9] isis ipv6 enable 1 [*PE2-Gigabitethernet0/1/9] ipv6 address 2001:db08:3::1 64 [*PE2-Gigabitethernet0/1/9] commit [*PE2-Gigabitethernet0/1/9] quit
<HUAWEI> system-view [~HUAWEI] sysname PE3 [*HUAWEI] commit [*PE3] isis 1 [*PE3-isis-1] cost-style wide [*PE3-isis-1] network-entity 10.0000.0000.0004.00 [*PE3-isis-1] ipv6 enable topology compatible [*PE3-isis-1] quit [*PE3] interface loopback5 [*PE3-loopback5] ipv6 enable [*PE3-loopback5] isis ipv6 enable 1 [*PE3-loopback5] ipv6 address 2001:DB08:4::2 128 [*PE2-loopback5] quit [*PE3] interface gigabitethernet0/1/9 [*PE3-Gigabitethernet0/1/9] ipv6 enable [*PE3-Gigabitethernet0/1/9] isis ipv6 enable 1 [*PE3-Gigabitethernet0/1/9] ipv6 address 2001:db08:3::2 64 [*PE3-Gigabitethernet0/1/9] commit [*PE3-Gigabitethernet0/1/9] quit
<HUAWEI> system-view [~HUAWEI] sysname CE1 [*HUAWEI] commit [~CE1] interface gigabitethernet 0/1/1 [~CE1-GigabitEthernet0/1/1] portswitch [*CE1-GigabitEthernet0/1/1] undo shutdown [*CE1-GigabitEthernet0/1/1] port link-type trunk [*CE1-GigabitEthernet0/1/1] port trunk allow-pass vlan 2 [*CE1-GigabitEthernet0/1/1] quit [*CE1] commit
# Configure PE1.
[~PE1] l2tpv3 enable [*PE1] commit
# Configure PE2.
[~PE2] l2tpv3 enable [*PE2] commit
# Configure PE3.
[~PE3] l2tpv3 enable [*PE3] commit
# Configure PE1.
[~PE1] interface gigabitethernet0/1/1.4 mode l2 [*PE1-Gigabitethernet0/1/1.4] encapsulation qinq vid 2 ce-vid 2 [*PE1-Gigabitethernet0/1/1.4] rewrite pop double [*PE1-Gigabitethernet0/1/1.4] commit
If you configure PE1 to allow services to access the L2TPv3 tunnel in whole-interface mode, run the following commands:
[*PE1] interface gigabitethernet0/1/1.4 mode l2 [*PE1-Gigabitethernet0/1/1.4] encapsulation default [*PE1-Gigabitethernet0/1/1.4] commit
If you configure PE1 to allow services to access the L2TPv3 tunnel in C-tag termination mode, run the following commands:
[*PE1] interface gigabitethernet0/1/1.4 mode l2 [*PE1-Gigabitethernet0/1/1.4] encapsulation dot1q vid 2 [*PE1-Gigabitethernet0/1/1.4] rewrite pop single [*PE1-Gigabitethernet0/1/1.4] commit
If you configure PE1 to allow services to access the L2TPv3 tunnel in S-tag termination mode, run the following commands:
[*PE1] interface gigabitethernet0/1/1 [*PE1-Gigabitethernet0/1/1] qinq protocol 88a8 [*PE1-Gigabitethernet0/1/1] interface gigabitethernet0/1/1.4 mode l2 [*PE1-Gigabitethernet0/1/1.4] encapsulation dot1q vid 2 [*PE1-Gigabitethernet0/1/1.4] rewrite pop single [*PE1-Gigabitethernet0/1/1.4] commit
# Configure PE2.
[*PE2] interface gigabitethernet0/1/1.4 mode l2 [*PE2-Gigabitethernet0/1/1.4] encapsulation qinq vid 2 ce-vid 2 [*PE2-Gigabitethernet0/1/1.4] rewrite pop double [*PE2-Gigabitethernet0/1/1.4] commit
If you configure PE2 to allow services to access the L2TPv3 tunnel in whole-interface mode, run the following commands:
[*PE2] interface gigabitethernet0/1/1.4 mode l2 [*PE2-Gigabitethernet0/1/1.4] encapsulation default [*PE2-Gigabitethernet0/1/1.4] commit
If you configure PE2 to allow services to access the L2TPv3 tunnel in C-tag termination mode, run the following commands:
[*PE2] interface gigabitethernet0/1/1.4 mode l2 [*PE2-Gigabitethernet0/1/1.4] encapsulation dot1q vid 2 [*PE2-Gigabitethernet0/1/1.4] rewrite pop single [*PE2-Gigabitethernet0/1/1.4] commit
If you configure PE2 to allow services to access the L2TPv3 tunnel in S-tag termination mode, run the following commands:
[*PE2] interface gigabitethernet0/1/1 [*PE2-Gigabitethernet0/1/1] qinq protocol 88a8 [*PE2-Gigabitethernet0/1/1] interface gigabitethernet0/1/1.4 mode l2 [*PE2-Gigabitethernet0/1/1.4] encapsulation dot1q vid 2 [*PE2-Gigabitethernet0/1/1.4] rewrite pop single [*PE2-Gigabitethernet0/1/1.4] commit
# Configure PE1.
[~PE1] l2tpv3 pw huawei [*PE1-l2tpv3-pw-huawei] source interface loopback 2 ipv6 2001:db08:1::1 [*PE1-l2tpv3-pw-huawei] destination 2001:db08:4::1 [*PE1-l2tpv3-pw-huawei] l2tpv3 local cookie key cipher Huawei-1 [*PE1-l2tpv3-pw-huawei] l2tpv3 remote cookie key cipher Huawei-1 [*PE1-l2tpv3-pw-huawei] quit [*PE1] interface gigabitethernet0/1/9 [*PE1-Gigabitethernet0/1/9] ipv6 enable [*PE1-Gigabitethernet0/1/9] commit [*PE1-Gigabitethernet0/1/9] quit [*PE1] interface gigabitethernet0/1/1.4 mode l2 [*PE1-Gigabitethernet0/1/1.4] l2tpv3 instance a123 [*PE1-Gigabitethernet0/1/1.4-l2tpv3-instance-a123] l2tpv3 static binding pw huawei [*PE1-Gigabitethernet0/1/1.4-l2tpv3-instance-a123] commit [~PE1-Gigabitethernet0/1/1.4-l2tpv3-instance-a123] quit [~PE1-Gigabitethernet0/1/1.4] quit
[~PE2] l2tpv3 pw huawei [*PE2-l2tpv3-pw-huawei] source interface loopback 4 ipv6 2001:db08:4::1 [*PE2-l2tpv3-pw-huawei] destination 2001:db08:1::1 [*PE2-l2tpv3-pw-huawei] l2tpv3 local cookie key cipher Huawei-1 [*PE2-l2tpv3-pw-huawei] l2tpv3 remote cookie key cipher Huawei-1 [*PE2-l2tpv3-pw-huawei] quit [*PE2] interface gigabitethernet0/1/9 [*PE2-Gigabitethernet0/1/9] ipv6 enable [*PE2-Gigabitethernet0/1/9] commit [*PE2-Gigabitethernet0/1/9] quit [*PE2] interface gigabitethernet0/1/1.4 mode l2 [*PE2-Gigabitethernet0/1/1.4] l2tpv3 instance a234 [*PE2-Gigabitethernet0/1/1.4-l2tpv3-instance-a234] l2tpv3 static binding pw huawei [*PE2-Gigabitethernet0/1/1.4-l2tpv3-instance-a234] commit [~PE2-Gigabitethernet0/1/1.4-l2tpv3-instance-a234] quit [~PE2-Gigabitethernet0/1/1.4] quit
[~CE2] interface gigabitethernet 0/1/1 [~CE2-GigabitEthernet0/1/1] portswitch [*CE2-GigabitEthernet0/1/1] undo shutdown [*CE2-GigabitEthernet0/1/1] port link-type trunk [*CE2-GigabitEthernet0/1/1] port trunk allow-pass vlan 2 [*CE2-GigabitEthernet0/1/1] quit [*CE2] commit
# Configure PE1.
[*PE1] interface gigabitethernet0/1/25.4 mode l2 [*PE1-Gigabitethernet0/1/25.4] encapsulation default [*PE1-Gigabitethernet0/1/25.4] commit
If you configure PE1 to allow services to access the L2TPv3 tunnel in S-tag+C-tag termination mode, run the following commands:
[*PE1] interface gigabitethernet0/1/25.4 mode l2 [*PE1-Gigabitethernet0/1/25.4] encapsulation qinq vid 2 ce-vid 2 [*PE1-Gigabitethernet0/1/25.4] rewrite pop double [*PE1-Gigabitethernet0/1/25.4] commit
If you configure PE1 to allow services to access the L2TPv3 tunnel in C-tag termination mode, run the following commands:
[*PE1] interface gigabitethernet0/1/25.4 mode l2 [*PE1-Gigabitethernet0/1/25.4] encapsulation dot1q vid 2 [*PE1-Gigabitethernet0/1/25.4] rewrite pop single [*PE1-Gigabitethernet0/1/25.4] commit
If you configure PE1 to allow services to access the L2TPv3 tunnel in S-tag termination mode, run the following commands:
[*PE1] interface gigabitethernet0/1/25 [*PE1-Gigabitethernet0/1/25] qinq protocol 88a8 [*PE1-Gigabitethernet0/1/25] quit [*PE1] interface gigabitethernet0/1/25.4 mode l2 [*PE1-Gigabitethernet0/1/25.4] encapsulation dot1q vid 2 [*PE1-Gigabitethernet0/1/25.4] rewrite pop single [*PE1-Gigabitethernet0/1/25.4] commit
# Configure PE3.
[*PE3] interface gigabitethernet0/1/1.4 mode l2 [*PE3-Gigabitethernet0/1/1.4] encapsulation default [*PE3-Gigabitethernet0/1/1.4] commit
If you configure PE3 to allow services to access the L2TPv3 tunnel in S-tag+C-tag termination mode, run the following commands:
[*PE3] interface gigabitethernet0/1/1.4 mode l2 [*PE3-Gigabitethernet0/1/1.4] encapsulation qinq vid 2 ce-vid 2 [*PE3-Gigabitethernet0/1/1.4] rewrite pop double [*PE3-Gigabitethernet0/1/1.4] commit
If you configure PE3 to allow services to access the L2TPv3 tunnel in C-tag termination mode, run the following commands:
[*PE3] interface gigabitethernet0/1/1.4 mode l2 [*PE3-Gigabitethernet0/1/1.4] encapsulation dot1q vid 2 [*PE3-Gigabitethernet0/1/1.4] rewrite pop single [*PE3-Gigabitethernet0/1/1.4] commit
If you configure PE3 to allow services to access the L2TPv3 tunnel in S-tag termination mode, run the following commands:
[*PE3] interface gigabitethernet0/1/1 [*PE3-Gigabitethernet0/1/1] qinq protocol 88a8 [*PE3-Gigabitethernet0/1/1] interface gigabitethernet0/1/1.4 mode l2 [*PE3-Gigabitethernet0/1/1.4] encapsulation dot1q vid 2 [*PE3-Gigabitethernet0/1/1.4] rewrite pop single [*PE3-Gigabitethernet0/1/1.4] commit
# Configure PE1.
[~PE1] l2tpv3 pw huawei1 [*PE1-l2tpv3-pw-huawei1] source interface loopback 3 ipv6 2001:db08:1::2 [*PE1-l2tpv3-pw-huawei1] destination 2001:db08:4::2 [*PE1-l2tpv3-pw-huawei1] l2tpv3 local cookie key cipher Huawei-1 [*PE1-l2tpv3-pw-huawei1] l2tpv3 remote cookie key cipher Huawei-1 [*PE1-l2tpv3-pw-huawei1] quit [*PE1] interface gigabitethernet0/1/17 [*PE1-Gigabitethernet0/1/17] ipv6 enable [*PE1-Gigabitethernet0/1/17] commit [*PE1-Gigabitethernet0/1/17] quit [*PE1] interface gigabitethernet0/1/25.4 mode l2 [*PE1-Gigabitethernet0/1/25.4] l2tpv3 instance a345 [*PE1-Gigabitethernet0/1/25.4-l2tpv3-instance-a345] l2tpv3 static binding pw huawei1 [*PE1-Gigabitethernet0/1/25.4-l2tpv3-instance-a345] commit [~PE1-Gigabitethernet0/1/25.4-l2tpv3-instance-a345] quit [~PE1-Gigabitethernet0/1/25.4] quit
[~PE3] l2tpv3 pw huawei1 [*PE3-l2tpv3-pw-huawei1] source interface loopback 5 ipv6 2001:db08:4::2 [*PE3-l2tpv3-pw-huawei1] destination 2001:db08:1::2 [*PE3-l2tpv3-pw-huawei1] l2tpv3 local cookie key cipher Huawei-1 [*PE3-l2tpv3-pw-huawei1] l2tpv3 remote cookie key cipher Huawei-1 [*PE3-l2tpv3-pw-huawei] quit [*PE3] interface gigabitethernet0/1/9 [*PE3-Gigabitethernet0/1/9] ipv6 enable [*PE3-Gigabitethernet0/1/9] commit [*PE3-Gigabitethernet0/1/9] quit [*PE3] interface gigabitethernet0/1/1.4 mode l2 [*PE3-Gigabitethernet0/1/1.4] l2tpv3 instance a456 [*PE3-Gigabitethernet0/1/1.4-l2tpv3-instance-a456] l2tpv3 static binding pw huawei1 [*PE3-Gigabitethernet0/1/1.4-l2tpv3-instance-a456] commit [~PE3-Gigabitethernet0/1/1.4-l2tpv3-instance-a456] quit [~PE3-Gigabitethernet0/1/1.4] quit
[~CE3] interface gigabitethernet 0/1/1 [~CE3-GigabitEthernet0/1/1] portswitch [*CE3-GigabitEthernet0/1/1] undo shutdown [*CE3-GigabitEthernet0/1/1] port link-type trunk [*CE3-GigabitEthernet0/1/1] port trunk allow-pass vlan 2 [*CE3-GigabitEthernet0/1/1] quit [*CE3] commit
Run the display l2tpv3 pw command to check tunnel status. If Tunnel State is displayed as up, the L2TPv3 tunnels are successfully configured.
[~PE1] display l2tpv3 pw huawei Tunnel Name : huawei Client interface : GigabitEthernet0/1/1.4 Tunnel State : up Source Interface : LoopBack2 Source Address : 2001:db8::1:1 Destination Address : 2001:db8::4:1 Local Session ID : 4294967295 Remote Session ID : 4294967295 [~PE1] display l2tpv3 pw huawei1 Tunnel Name : huawei1 Client interface : GigabitEthernet0/1/1.4 Tunnel State : up Source Interface : LoopBack3 Source Address : 2001:db8::1:2 Destination Address : 2001:db8::4:2 Local Session ID : 4294967295 Remote Session ID : 4294967295
CE1 configuration file
#
sysname CE1
#
vlan 2
#
interface GigabitEthernet0/1/1
portswitch
undo shutdown
port link-type trunk
port trunk allow-pass vlan 2
#
return
PE1 configuration file
# sysname PE1 # isis 1 cost-style wide network-entity 10.0000.0000.0002.00 # ipv6 enable topology compatible # interface LoopBack2 ipv6 enable ipv6 address 2001:DB08:1::1 128 isis ipv6 enable 1 # interface LoopBack3 ipv6 enable ipv6 address 2001:DB08:1::2 128 isis ipv6 enable 1 # interface GigabitEthernet0/1/9 ipv6 enable ipv6 address 2001:DB08:2::1 64 isis ipv6 enable 1 # interface GigabitEthernet0/1/17 ipv6 enable ipv6 address 2001:DB08:2::2 64 isis ipv6 enable 1 # l2tpv3 enable l2tpv3 pw huawei source interface LoopBack 2 ipv6 2001:db08:1::1 destination 2001:DB08:4::1 128 l2tpv3 local cookie key cipher %#%#1"*U8`%XqIko*T4Kj"}/8.j!Ge-"~KlLv=<!p(!-%#%# l2tpv3 remote cookie key cipher %#%#ZM`lUZ0(E$diG3OR%[U&Z_3!GBp>24#caX%uAn^D%#%# # l2tpv3 pw huawei1 source interface LoopBack 3 ipv6 2001:db08:1::2 destination 2001:DB08:4::2 128 l2tpv3 local cookie key cipher %#%#uOIwFI,!_<-$&.)+{Lq#zoI.OAoao+c$I3=huT>:%#%# l2tpv3 remote cookie key cipher %#%#>nJTCLh0U*#U%jF@i'0LqO}*JZYL]Mq=M($'&}KL%#%# # interface Gigabitethernet0/1/1.4 mode l2 encapsulation qinq vid 2 ce-vid 2 rewrite pop double l2tpv3 instance a123 l2tpv3 static binding pw huawei # interface Gigabitethernet0/1/25.4 mode l2 encapsulation default l2tpv3 instance a345 l2tpv3 static binding pw huawei1 #
PE2 configuration file
# sysname PE2 # isis 1 cost-style wide network-entity 10.0000.0000.0003.00 # ipv6 enable topology compatible # interface LoopBack4 ipv6 enable ipv6 address 2001:DB08:4::1 128 isis ipv6 enable 1 # interface GigabitEthernet0/1/9 ipv6 enable ipv6 address 2001:DB08:3::1 64 isis ipv6 enable 1 # l2tpv3 enable l2tpv3 pw huawei source interface LoopBack 4 ipv6 2001:db08:4::1 destination 2001:DB08:1::1 l2tpv3 local cookie key cipher %#%#M;2^%B|jX,Ss!DM\]dc:Y45_!URg>4M2/058ub+=%#%# l2tpv3 remote cookie key cipher %#%#8u.iEnZN^1Xj`ZS@S|@55%.3LN3=r)I_o{W~R8V"%#%# # interface GigabitEthernet0/1/1.4 mode l2 encapsulation qinq vid 2 ce-vid 2 rewrite pop double l2tpv3 instance a234 l2tpv3 static binding pw huawei #
CE2 configuration file
#
sysname CE2
#
interface GigabitEthernet0/1/1
portswitch
undo shutdown
port link-type trunk
port trunk allow-pass vlan 2
#
return
PE3 configuration file
# sysname PE3 # isis 1 cost-style wide network-entity 10.0000.0000.0004.00 # ipv6 enable topology compatible # interface LoopBack5 ipv6 enable ipv6 address 2001:DB08:4::2 128 isis ipv6 enable 1 # interface GigabitEthernet0/1/9 ipv6 enable ipv6 address 2001:DB08:3::2 64 isis ipv6 enable 1 # l2tpv3 enable l2tpv3 pw huawei1 source interface LoopBack 5 ipv6 2001:DB08:4::2 destination 2001:DB08:1::2 l2tpv3 local cookie key cipher %#%#8Hj5Wwpi80&\BuS<)1g1vscEDe\9gX-CVR$rGsYS%#%# l2tpv3 remote cookie key cipher %#%#6v3(+'}M%Cn]3'>g\>v$1,h`LfZ'AV,JoI.-%I,Q%#%# # interface Gigabitethernet0/1/1.4 mode l2 encapsulation qinq default l2tpv3 instance a456 l2tpv3 static binding pw huawei1 #
CE3 configuration file
#
sysname CE3
#
interface GigabitEthernet0/1/1
portswitch
undo shutdown
port link-type trunk
port trunk allow-pass vlan 2
#
return