AlliedWareTM OS How To | Configure VPNs in a Corporate Network, with Optional Prioritisation of VoIP Introduction In this How To Note’s example, a headquarters office has VPNs to two branch offices and a number of roaming VPN clients.
How to make voice traffic high priority ........................................................................................... How to prioritise outgoing VoIP traffic from the headquarters router ............................ How to prioritise outgoing VoIP traffic from the branch office 1 router ......................... How to prioritise outgoing VoIP traffic from the branch office 2 router ......................... 30 31 33 35 How to test your VPN solution ..........................................
About IPsec modes: tunnel and transport This solution uses two types of VPN: z IPsec tunnel mode, for the headquarters office to branch office VPNs. These are site-tosite (router-to-router) VPNs. z IPsec transport mode with L2TP, for the roaming Windows VPN clients. The following figure shows the protocol stacks for the tunnel mode VPN and the transport mode VPN for the connection type PPPoA.
Background: NAT-T and policies NAT-T NAT Traversal (NAT-T) can be enabled on any of our IPsec VPN links. It automatically allows IPsec VPNs to traverse any NAT gateways that may be in the VPN path. This is likely to occur with the VPNs from the roaming VPN clients—they are likely to use a LAN at a remote site that is behind a NAT gateway. NAT-T may also be applicable for a site-to-site VPN, if one of the routers is behind a NAT gateway, such as some ADSL devices.
Policies and interfaces It is useful to keep in mind that you apply firewall rules and IPsec policies to interfaces in the following different ways: z Firewall rules can be applied on either private or public interfaces. The rules are matched against traffic that comes into the interface to which they were applied. Rules applied to private interfaces are typically quite different to rules applied to public interfaces. z IPsec policies are applied only on the public interface.
How to configure VPNs in typical corporate networks This section describes a typical corporate network using secure VPN. The network consists of a headquarters (HQ) router and two branch office routers. The headquarters router is acting as a VPN Access Concentrator, and allows for VPN access from either of the branch office sites or from roaming laptop VPN clients. The network is illustrated in the following figure. branch office 1 VPN router VLAN 1 ISP’s router Telco’s ADSL exchange 222.222.222.1 222.
2. The branch office 1 router, which provides: z an ADSL PPPoA Internet connection. Note that the PPPoA connection requires an ATM DSLAM z VPN access to headquarters using IPsec tunnel mode z incoming VPN client access from roaming users z a fixed Internet address so that roaming VPN clients have a known target for the branch office end of the VPN 3.
Headquarters How to configure the headquarters VPN access concentrator Before you begin to configure your router, ensure that it is running the appropriate software release, patch and GUI files and has no configuration.
Headquarters 2. Configure IP for internet access Give a fixed public address to the interface eth0, which is the Internet connection interface. You can replace eth0 with ppp0 if you use a leased line. enable ip add ip int=eth0 ip=200.200.200.1 Give a fixed private address to the interface vlan1, which connects the router to the headquarters LAN. add ip int=vlan1 ip=192.168.140.254 Set the default route. The next hop is the gateway address provided by the ISP. add ip rou=0.0.0.0 mask=0.0.0.
Headquarters remote security officers (RSOs). RSO definitions specify trusted remote addresses for security officer users. add user rso ip=[-] enable user rso enable telnet server 4. Capture status information remotely, if desired If desired, set the router to send log messages to a syslog server.
Headquarters 6. Check feature licences Check that you have a 3DES feature licence for the ISAKMP policies. show feature You can purchase feature licences from your Allied Telesis distributor. If necessary, install the licence, using the password provided by your distributor. enable feature=3des pass= 7.
Headquarters Create IPsec policies to bypass IPsec for ISAKMP messages and the “port floated” key exchange that NAT-T uses. create ipsec pol=isakmp int=eth0 ac=permit lp=500 rp=500 create ipsec pol=isakmp_float int=eth0 ac=permit lp=4500 Create an IPsec policy for the VPN traffic between headquarters and branch office 1. Identify the traffic by its local and remote addresses—in this example the subnet used on the LAN at branch office 1 (remote) is 192.168.141.0/24.
Headquarters z the branch office policies use a different encryption transform—3des2key—than the roaming policy. When a new incoming ISAKMP message starts, this lets the router identify whether to match it to the roaming policy or one of the branch office policies. z the policies include local IDs. These allow the remote peers to identify incoming ISAKMP packets from the headquarters router through any NAT gateways in the path. Create an ISAKMP policy for the VPN to branch 1, with a fixed address.
Headquarters can trust traffic arriving on the dynamic interfaces because—in this example configuration—it can only come from an authenticated and encrypted VPN connection. create firewall policy=hq dynamic=roaming add firewall policy=hq dynamic=roaming user=any add firewall policy=hq int=dyn-roaming type=private Define NAT definitions to use when traffic from the local LAN accesses the Internet and to allow Internet access for remote VPN client users.
Headquarters The rule for the private interface uses both source and destination addresses to identify outgoing VPN traffic. add firewall policy=hq ru=5 ac=non int=vlan1 prot=all ip=192.168.140.1-192.168.140.254 rem=192.168.141.0-192.168.144.254 If you configured SSH (recommended), create a rule to allow SSH traffic to pass through the firewall. add firewall policy=hq ru=6 ac=allo int=eth0 prot=tcp po=22 ip=200.200.200.1 gblip=200.200.200.
branch office 1 How to configure the AR440S router at branch office 1 Before you begin to configure your router, ensure that it is running the appropriate software release, patch and GUI files and has no configuration.
branch office 1 2. Configure ADSL for internet access Create your Asymmetric Digital Subscriber Line (ADSL) connection. Asynchronous Transfer Mode (ATM) is always used over ADSL. enable adsl=0 create atm=0 over=adsl0 add atm=0 channel=1 3. Configure PPP for PPPoA Create your PPPoA link, and define the username and password needed for Internet access. This is provided by your Internet Service Provider (ISP). create ppp=0 over=atm0.
branch office 1 5. Configure remote management access, if desired If you need remote management access, we strongly recommend that you use Secure Shell (SSH). You should not telnet to a secure gateway. To configure SSH, define appropriate RSA encryption keys, then enable the SSH server.
branch office 1 7. Configure dynamic PPP over L2TP connections You need to configure dynamic PPP over L2TP to accept incoming Windows VPN client connections. Create an IP pool to allocate unique internal payload addresses to incoming VPN clients. create ip pool=roaming ip=192.168.144.1-192.168.144.50 Define a PPP template. This defines authentication and uses the IP pool of addresses. create ppp template=1 set ppp template=1 bap=off ippool=roaming authentication=chap echo=10 lqr=off Configure L2TP.
branch office 1 z (for site-to-site VPNs) 3DESOUTER as the encryption algorithm for ESP z (for site-to-site VPNs) SHA as the hashing algorithm for ESP authentication z (for roaming client VPNs) four possible variants of VPN encryption, for added flexibility. We propose the most secure option first. Create an SA specification for the headquarters office site-to-site VPN. This SA specification uses tunnel mode by default.
branch office 1 Create your ISAKMP pre-shared key. This key is used when initiating your VPN during phase one ISAKMP exchanges with your VPN peers. Share the value of this pre-shared key with all VPN peers that use it—in this example, the roaming VPN clients and the headquarters router. The router only uses this key during phase one ISAKMP exchanges. create enco key=1 type=general value= Enable ISAKMP.
branch office 1 can trust traffic arriving on the dynamic interfaces because—in this example configuration—it can only come from an authenticated and encrypted VPN connection. create firewall policy=branch1 dynamic=roaming add firewall policy=branch1 dynamic=roaming user=any add firewall policy=branch1 int=dyn-roaming type=private Define NAT definitions to use when traffic from the local LAN accesses the Internet and to allow Internet access for remote VPN client users.
branch office 1 The rule for the private interface uses both source and destination addresses to identify outgoing VPN traffic. add firewall policy=branch1 ru=5 ac=non int=vlan1 prot=all ip=192.168.141.1-192.168.141.254 rem=192.168.140.0-192.168.142.254 If you configured SSH (recommended), create a rule to allow SSH traffic to pass through the firewall. add firewall policy=branch1 ru=6 ac=allo int=ppp0 prot=tcp po=22 ip=222.222.222.1 gblip=222.222.222.
branch office 2 How to configure the AR440S router at branch office 2 Before you begin to configure your router, ensure that it is running the appropriate software release, patch and GUI files and has no configuration.
branch office 2 2. Configure ADSL for internet access Create your Asymmetric Digital Subscriber Line (ADSL) connection. Asynchronous Transfer Mode (ATM) is always used over ADSL. enable adsl=0 create atm=0 over=adsl0 add atm=0 channel=1 Branch 2 uses PPPoEoA (PPP over virtual ethernet over ATM). Create the virtual ethernet over ATM. create eth=0 over=atm0.1 3. Configure PPP for PPPoE Create your PPPoE link, and define the username and password needed for Internet access.
branch office 2 If desired, set up the router as a DHCP server for the branch office 2 LAN. create dhcp policy=branch2 lease=7200 add dhcp policy=branch2 rou=192.168.142.254 add dhcp policy=branch2 subn=255.255.255.0 create dhcp range=branch2_hosts poli=branch2 ip=192.168.142.16 num=32 ena dhcp 5. Configure remote management access, if desired If you need remote management access, we strongly recommend that you use Secure Shell (SSH). You should not telnet to a secure gateway.
branch office 2 7. Check feature licences Check that you have a 3DES feature licence for the ISAKMP policy. show feature You can purchase feature licences from your Allied Telesis distributor. If necessary, install the licence, using the password provided by your distributor. enable feature=3des pass= 8.
branch office 2 Create another IPsec policy for direct Internet traffic from the headquarters LAN to the Internet, such as web browsing. create ipsec pol=internet int=ppp0 ac=permit Note: The order of the IPsec policies is important. The Internet permit policy must be last. Create your ISAKMP pre-shared key. This key is used when initiating your VPN during phase one ISAKMP exchanges with your VPN peers.
branch office 2 Branch office 2 does not need rule 3 that the other sites have, because branch office 2 has no roaming VPN client connections. Create a pair of rules to allow office-to-office payload traffic to pass through the firewall without applying NAT. This traffic must bypass NAT so that the traffic matches subsequent IPsec policy address selectors.
How to make voice traffic high priority This is an optional enhancement to the configuration of the routers. It prioritises outgoing voice traffic higher than other outgoing traffic on each VPN, to maximise call quality. Use the configuration in this section if you expect your VPN client or branch office users will be using VoIP over a VPN.
Headquarters How to prioritise outgoing VoIP traffic from the headquarters router Add the following steps after step 9 on page 14. 1. Create classifiers First, classify the VoIP traffic. In many deployments of VoIP, the originating VoIP appliance marks VoIP packets with a DSCP value. In this example, it marks both VoIP traffic and VoIP signalling packets with DSCP 48. create classifier=48 ipds=48 2. Reduce the MTU VoIP data packets are small.
Headquarters 4. For site-to-site VPNs, apply the SQoS policy to the tunnels Apply the policy to the VPN between headquarters and branch office 1. set sqos interface=ipsec-branch1 tunnelpolicy=1 Apply the policy to the VPN between headquarters and branch office 2. set sqos interface=ipsec-branch2 tunnelpolicy=1 5. For roaming clients, use triggers to apply SQoS to dynamic interfaces This example creates four triggers, which allows for up to four simultaneous roaming client VPNs.
branch office 1 How to prioritise outgoing VoIP traffic from the branch office 1 router Add the following steps after step 11 on page 22. 1. Create classifiers In this example, the originating VoIP appliance has marked VoIP traffic and VoIP signalling packets with DSCP 48. create classifier=48 ipds=48 2. Reduce the MTU VoIP data packets are small. They can be significantly delayed by big packets on the WAN port, especially on slow links.
branch office 1 5. For roaming clients, use triggers to apply SQoS to dynamic interfaces This example creates four triggers, which allows for up to four simultaneous roaming client VPNs. You can scale this to the correct number for your network. Create the following scripts as text files on the router. script name script contents ppp0up.scp set sqos int=ppp0 outpolicy=1 ppp1up.scp set sqos int=ppp1 outpolicy=1 ppp2up.scp set sqos int=ppp2 outpolicy=1 ppp3up.
branch office 2 How to prioritise outgoing VoIP traffic from the branch office 2 router Add the following steps after step 11 on page 22. 1. Create classifiers In this example, the originating VoIP appliance has marked VoIP traffic and VoIP control packets with DSCP 48. create classifier=48 ipds=48 2. Reduce the MTU VoIP data packets are small. They can be significantly delayed by big packets on the WAN port, especially on slow links.
How to test your VPN solution If the following tests show that your tunnel is not working, see the How To Note How To Troubleshoot A Virtual Private Network (VPN). Check the LANs are reachable The simplest way to test a tunnel is to ping from one LAN to the other. From a PC attached to one peer, ping a PC attached to the other peer. For example, you can test the VPN between branch office 1 and headquarters by pinging any PC in the branch office 1 LAN from any PC in the headquarters LAN.
Configuration scripts for headquarters and branch offices This section provides script-only versions of the three configurations described earlier in this document. Scripts can provide a quicker way to configure your routers, through pre-editing and downloading using TFTP or ZMODEM. You can copy and paste the scripts below to an editor on your PC, modify addresses, passwords and any other requirements for all your individual sites, and then use TFTP or ZMODEM to transfer the files to your routers.
Headquarters Headquarters VPN access concentrator's configuration # System configuration set system name=HQ # User configuration set user securedelay=600 # Add your approved roaming VPN client usernames. add user=roaming1 pass=roaming1 lo=no telnet=no add user=roaming2 pass=roaming2 lo=no telnet=no add user=roaming3 pass=roaming3 lo=no telnet=no add user=roaming4 pass=roaming4 lo=no telnet=no # Define a security officer.
Headquarters # DHCP configuration # If desired, use the router as a DHCP server. create dhcp poli=hq lease=7200 add dhcp poli=hq rou=192.168.140.254 add dhcp poli=hq subn=255.255.255.0 create dhcp range=hq_hosts poli=hq ip=192.168.140.16 num=32 ena dhcp # SSH configuration # You should not telnet to a secure gateway, so set up Secure Shell # for remote management. This requires encryption keys - see # "Before you start" on page 7. # Enable the SSH server.
Headquarters # Create a group of SA specifications for the roaming VPN clients. # These SA specifications use IPsec transport mode.
Headquarters # FIREWALL configuration enable firewall create firewall policy=hq enable firewall policy=hq icmp_f=all # Define a firewall dynamic definition to work with dynamic # interfaces. This provides for the dynamic PPP/L2TP interfaces that # incoming Windows VPN connections use. create firewall policy=hq dy=roaming add firewall policy=hq dy=roaming user=any # Specify the private and public interfaces.
Headquarters # If you configured SSH, create a rule for SSH traffic. add firewall policy=hq ru=6 ac=allo int=eth0 prot=tcp po=22 ip=200.200.200.1 gblip=200.200.200.1 gblp=22 # If you use telnet instead (not recommended), create a rule for it. # add firewall policy=hq ru=7 ac=allo int=eth0 prot=tcp po=23 # ip=200.200.200.1 gblip=200.200.200.
branch office 1 Branch office 1 AR440S configuration—the PPPoA site with VPN client access and a fixed IP address # SYSTEM configuration set system name=Branch1 # USER configuration set user securedelay=600 # Add your approved roaming VPN client usernames. add user=roaming1 pass=roaming1 lo=no telnet=no add user=roaming2 pass=roaming2 lo=no telnet=no add user=roaming3 pass=roaming3 lo=no telnet=no add user=roaming4 pass=roaming4 lo=no telnet=no # Define a security officer.
branch office 1 # allows incoming roaming VPN client connections. The clients can # only target a known, unchanging address. create ppp=0 over=atm0.1 echo=10 lqr=off bap=off idle=off set ppp=0 username="branch office 1" password=branch1 iprequest=off # Note that this interface needs a permanent IP address because the # branch office allows incoming roaming VPN client connections. The # clients can only target a known, unchanging address. # IP configuration enable ip add ip int=vlan1 ip=192.168.141.
branch office 1 # Log configuration # If desired, forward router log entries to a UNIX-style syslog # server. create log output=2 destination=syslog server= syslogformat=extended add log out=2 filter=1 sev=>3 # IPSEC configuration # Create an SA specification for the site-to-site VPN. This SA # specification uses tunnel mode by default. create ipsec sas=1 key=isakmp prot=esp enc=3desouter hasha=sha # Create a group of SA specifications for the roaming VPN clients.
branch office 1 # ISAKMP Configuration create isakmp pol=hq pe=200.200.200.1 key=1 sendd=true heart=both set isa pol=hq localid=branch1 encalg=3des2key create isakmp pol=roaming pe=any key=1 set isa pol=roaming sendd=true sendi=true natt=true localid=branch1 enable isakmp # FIREWALL configuration enable firewall create firewall policy=branch1 enable firewall policy=branch1 icmp_f=all # Define a firewall dynamic definition to work with dynamic # interfaces.
branch office 1 # # # # Create a pair of rules to allow office-to-office payload traffic to pass through the firewall without applying NAT. The rule for the public interface uses encapsulation=ipsec to identify incoming VPN traffic. add firewall poli=branch1 ru=4 ac=non int=ppp0 prot=all enc=ips # The rule for the private interface uses both source and destination # addresses to identify outgoing VPN traffic. add firewall poli=branch1 ru=5 ac=non int=vlan1 prot=all ip=192.168.141.1-192.168.141.
branch office 2 Branch office 2 AR440S configuration—the PPPoEoA site with a dynamically assigned IP address # SYSTEM configuration set system name=Branch2 # USER configuration set user securedelay=600 # Define a security officer. add user=secoff pass= priv=securityofficer lo=yes telnet=yes # Change the manager privilege user’s password. set user=manager password= # RADIUS configuration # If desired, add a RADIUS authentication server for authenticating # users.
branch office 2 # DHCP configuration # If desired, use the router as a DHCP server. create dhcp poli=branch2 lease=7200 add dhcp poli=branch2 rou=192.168.142.254 add dhcp poli=branch2 subn=255.255.255.0 create dhcp range=branch2_hosts poli=branch2 ip=192.168.142.16 num=32 ena dhcp # SSH configuration # You should not telnet to a secure gateway, so set up Secure Shell # for remote management. This requires encryption keys - see # "Before you start" on page 7. # Enable the SSH server.
branch office 2 # Create an IPsec policy for branch 2 to headquarters VPN traffic. create ipsec pol=hq int=ppp0 ac=ipsec key=isakmp bund=1 peer=200.200.200.1 isa=hq set ipsec pol=hq lad=192.168.142.0 lma=255.255.255.0 rad=192.168.0.0 rma=255.255.0.0 # Create another IPsec policy to allow for direct Internet access # such as web browsing. create ipsec pol=internet int=ppp0 ac=permit enable ipsec # ISAKMP Configuration create isakmp pol=hq pe=200.200.200.
branch office 2 # If you use telnet instead (not recommended), create a rule for it. # add firewall policy=branch2 ru=7 ac=allo int=ppp0 prot=tcp po=23 # ip=192.168.142.254 gblip=0.0.0.0 gblp=23 # INT configuration - if prioritising VoIP set int=ppp0 mtu=256 set int=ppp0 frag=yes # CLASSIFIER configuration - if prioritising VoIP # Create a classifier to identify voice traffic (DSCP value 48 in # this example).
Extra configuration scripts for lab testing the VPN solution This section provides additional configuration that you may need if you want to lab test the VPN solution. It has scripts for: z setting up a PPPoE access concentrator for branch office 2 to connect to. In a test network, this access concentrator plays the role of the PPPoA or PPPoEoA service from your ISP or Telco z setting up a NAT gateway so you can verify your VPN clients passing through NAT-T.
Hotel's NAT gateway firewall configuration # SYSTEM configuration set system name=Hotel # IP configuration enable ip add ip int=eth0 ip=211.211.211.1 add ip int=eth1 ip=192.168.200.254 add ip rou=0.0.0.0 mask=0.0.0.0 int=eth0 next=211.211.211.