CLI: Example for Configuring L2TP over IPSec to Allow Mobile Users to Access the Headquarters Using Mac OS X Terminals
Networking Requirements
As shown in Figure 3-24, a mobile user terminal (LAC) is connected to the LNS of the headquarters over the Internet. The LAC can initiate an IPSec tunnel connection request with the LNS to transmit data over a tunnel. L2TP encapsulates Layer 2 data and authenticates user identity, and then IPSec encrypts L2TP packets.
Data Plan
Item |
Data |
---|---|
LNS |
Interface number: GigabitEthernet 1/0/1 IP address: 1.1.1.2/24 |
Interface number: GigabitEthernet 1/0/3 IP address: 192.168.1.1/24 |
|
VT interface Interface number: Virtual-Template 1 IP address: 10.1.1.1/24 |
|
Address pool IP pool 1 IP address range: 10.1.1.2 to 10.1.1.100 |
|
L2TP configuration Authentication type: CHAP and PAP User name: macpc User authentication password: Hello123 Tunnel verification: Disabled |
|
IPSec configuration Establishment method: policy template Security protocol: ESP IKE authentication algorithm: SHA2-256 IKE encryption algorithm: AES-128 ESP authentication algorithm: SHA2-256 ESP encryption algorithm: AES-128 Pre-shared key: Admin@123 Local ID type: IP address Peer ID type: any IKE version: IKEv1 |
|
LAC client |
Server address: 1.1.1.2 Account: macpc Password: Hello123 Pre-shared key: Admin@123 |
Configuration Roadmap
- Complete basic firewall configurations, including the interfaces, security policies, and routes.
- Complete the L2TP over IPSec configuration on the FW.
- Complete the Mac OS X client configuration on the traveling employee's terminal. The parameters of the LAC must be consistent with those of the FW.
Procedure
- Configure the LNS.
- Configure a route to the headquarters intranet.
To communicate with traveling employees, the headquarters server must have routes to the employees. The IP addresses in the routes must be allocated from the L2TP address pool and the next hop must be the LAN interface address of the FW.
- Configure the mobile employee's PC.
Verification
Click Connect to set up a VPN tunnel.
After the VPN tunnel is set up, the connection status changes, as shown in the following figure:The displayed information shows that the VPN connection is Connected, the connection duration is 00:00:39, and the IP address assigned to the LAC client is 10.1.1.2. To terminate the VPN connection, click Disconnect.
When a VPN user is connected, run the display l2tp tunnel command on the LNS. You can find that a tunnel is established successfully.
<LNS> display l2tp tunnel L2TP::Total Tunnel: 1 LocalTID RemoteTID RemoteAddress Port Sessions RemoteName VpnInstance ------------------------------------------------------------------------------ 1 11800 3.3.3.3 54175 1 anonymous ------------------------------------------------------------------------------ Total 1, 1 printed
Run the display l2tp session command on the LNS. You can find that a session is successfully established.
<LNS> display l2tp session L2TP::Total Session: 1 LocalSID RemoteSID LocalTID RemoteTID UserID UserName VpnInstance ------------------------------------------------------------------------------ 1 2688 1 11800 30629 vpdnuser ------------------------------------------------------------------------------ Total 1, 1 printed
Run the display ike sa and display ipsec sa brief commands on the LNS. You can find that IKE and IPSec SAs are successfully established.
<LNS> display ike sa IKE SA information : Conn-ID Peer VPN Flag(s) Phase RemoteType RemoteID ------------------------------------------------------------------------------- 65254213 3.3.3.3:5524 RD|A v1:2 IP 3.3.3.3 65254123 3.3.3.3:5524 RD|A v1:1 IP 3.3.3.3 Number of IKE SA : 2 ------------------------------------------------------------------------------- Flag Description: RD--READY ST--STAYALIVE RL--REPLACED FD--FADING TO--TIMEOUT HRT--HEARTBEAT LKG--LAST KNOWN GOOD SEQ NO. BCK--BACKED UP M--ACTIVE S--STANDBY A--ALONE NEG--NEGOTIATING
<LNS> display ipsec sa brief current ipsec sa number: 2 current ipsec tunnel number: 1 Src Address Dst Address SPI Protocol Algorithm ------------------------------------------------------------------------------ 3.3.3.3 1.1.1.2 1826317110 ESP E:3DES A:SHA1-96 1.1.1.2 3.3.3.3 209587142 ESP E:3DES A:SHA1-96
Configuration Files
# sysname LNS # l2tp enable l2tp domain suffix-separator @ # acl number 3000 rule 5 permit udp source-port eq 1701 # ipsec proposal tran1 esp authentication-algorithm sha2-256 esp encryption-algorithm aes-128 # ike proposal 10 encryption-algorithm aes-128 dh group14 authentication-algorithm sha2-256 authentication-method pre-share integrity-algorithm hmac-sha2-256 prf hmac-sha2-256 # ike peer a local-id-type ip pre-shared-key %^%#)AsqM;q*K2"R^y0LfgB<D011%^%# ike-proposal 10 # ipsec policy-template policy_temp 1 security acl 3000 ike-peer a alias policy_temp_1 proposal tran1 # ipsec policy policy 10 isakmp template policy_temp # interface GigabitEthernet1/0/1 undo shutdown ip address 1.1.1.2 255.255.255.0 ipsec policy policy # interface GigabitEthernet1/0/3 undo shutdown ip address 192.168.1.1 255.255.255.0 # interface Virtual-Template1 ppp authentication-mode chap pap ip address 10.1.1.1 255.255.255.0 remote service-scheme l2tp # firewall zone trust set priority 85 add interface GigabitEthernet1/0/3 # firewall zone untrust set priority 5 add interface GigabitEthernet1/0/1 add interface Virtual-Template1 # l2tp-group default-lns allow l2tp virtual-template 1 undo tunnel authentication # ip pool pool1 section 1 10.1.1.2 10.1.1.100 # aaa authentication-scheme default authentication-mode local domain default authentication-scheme default service-scheme l2tp # security-policy rule name policy_ipsec_1 source-zone untrust destination-zone trust source-address range 10.1.1.2 10.1.1.100 destination-address 192.168.1.0 255.255.255.0 action permit rule name policy_ipsec_2 source-zone trust destination-zone untrust source-address range 192.168.1.0 255.255.255.0 destination-address 10.1.1.2 10.1.1.100 action permit rule name policy_ipsec_3 source-zone untrust destination-zone local destination-address 1.1.1.2 255.255.255.255 action permit rule name policy_ipsec_4 source-zone local destination-zone untrust source-address 1.1.1.2 255.255.255.255 action permit # return The following configurations for creating users/groups are stored in the database, not described in the configuration file. user-manage user vpdnuser domain default password *********