IPsec/IKEv2-based VPN software for Linux
# sudo brctl addbr br0
# sudo brctl addif eth0 # sudo ifconfig br0 192.168.0.100 netmask 255.255.255.0 # sudo route add default gw 192.168.0.10 |
# sudo ifconfig eth0 10.0.0.1 netmask 255.255.255.0
# sudo ifconfig eth1 192.168.0.10 netmask 255.255.255.0 # sudo sysctl net.ipv4.ip_forward=1 # sudo iptables -t nat -A PREROUTING -p udp --dst 10.0.0.1 --dport 500 -j DNAT --to-destination 192.168.0.100:500 # sudo iptables -t nat -A PREROUTING -p udp --dst 10.0.0.1 --dport 4500 -j DNAT --to-destination 192.168.0.100:4500 |
# sudo ifconfig eth0 10.0.0.10 netmask 255.255.255.0
# sudo ifconfig eth1 192.168.2.1 netmask 255.255.255.0 # sudo sysctl net.ipv4.ip_forward=1 # sudo iptables -t -nat -A POSTROUTING -o eth0 -j MASQUERADE --random |
# sudo ifconfig eth0 192.168.0.101 netmask 255.255.255.0 |
auto eth0
iface eth0 inet manual up /sbin/ifconfig eth0 promisc auto br0 iface br0 inet static address 192.168.0.100 network 192.168.0.0 netmask 255.255.255.0 gateway 192.168.0.10 broadcast 192.168.0.255 bridge_ports eth0 bridge_stp off bridge_maxwait 10 |
- VPN Configuration[Tab] > Edit VPN Realm(Save, Add, etc.)[Left-Tree]: Click this tree node and show Edit VPN Realm(Save, Add, Remove, or Load) pane.
- Click Add VPN Realm button.
- Add a VPN Realm[Dialog]: Enter the following, then click OK button.
Realm ID: 10
Realm Name: "Example VPN"
Description: "Config for Example VPN."
Mode: Bridge
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Bridge)[Left-Tree] > VPN Interface[Left-Tree]: Click this tree node and show VPN Tunnel/TAP Interface pane.
- Enter or select the following.
Internal Address Type: Unnumbered(for bridging)
Linked Bridge Name: br0
- If Remote Access Client communicates with hosts on other subnets like 192.168.1.0/24, please enter the following router's address. VPN Gateway will forward decrypted packets destinated to other subnets to the router(192.168.0.1).
Internal Gateway's IPv4 Address (optional): 192.168.0.1
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Bridge)[Left-Tree] > Network Interface[Left-Tree]: Click this tree node and show Network Interface pane.
- Uncheck Use default route and enter the followings.
Primary interface:
- Name: Select br0 as a source interface.
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Bridge)[Left-Tree] > Service[Left-Tree]: Click this tree node and show Service pane.
- Network Deployment: Select Hub(Concentrator) Node.
- Remote Configuration(IKEv2): Select Remote Configuration Server.
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Bridge)[Left-Tree] > Service[Left-Tree] > Remote Config Server[Left-Tree]:
Click this tree node and show Remote Config Server(IKEv2) pane.
- Remote Config Server(IKEv2)[Pane]
> Internal Address Pool[Tab]:
Click Add Address Pool button.
- Add a New Address Pool[Dialog]:
Enter the following, then click OK button.
Address Type: Address Range
IPv4 Address Range: 192.168.0.20 - 192.168.0.30
- Remote Config Server(IKEv2)[Pane]
> Internal Route Map[Tab]:
Enter the following as an Internal router's address.
Gateway IPv4 Address: 192.168.0.1
- Click Add Destination IPv4 Network button.
Add a New Internal Route[Dialog]:
Enter the following, then click OK button.
Destination IPv4 Network: 192.168.1.0
Netmask: 255.255.255.0
- Remote Config Server(IKEv2)[Pane]
> Internal DNS[Tab]:
Enter the following as an Internal DNS server's address.
DNS Server's IPv4 Address: 192.168.0.101
- Click Add DNS Suffix button.
Add a New DNS Suffix[Dialog]:
Enter the following, then click OK button.
DNS Suffix: .example.com
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Bridge)[Left-Tree] > My Key Store[Left-Tree]: Click this tree node and show My Key Store pane.
- Enter the following.
Authentication Method: RSA Signature(RSA-Sig)
My ID Type: auto
Key Format: PEM(Base64-encoding) - File
My Certificate(X.509, *.pem): gateway1.example.com-cert.pem
RSA private key(*.pem): gateway1.example.com-pkey.pem
RSA Private Key's Password: himitsu
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Bridge)[Left-Tree] > Peers' Key Store[Left-Tree]: Click this tree node and show Peers Key Store pane.
- Click Add Peer's Key/Password button.
Add a New Peer's Key[Dialog]: Enter the following, then click OK button.
Peer ID Type: IKEv2: Host Name(FQDN)
Peer ID: remoteclient1.example.com
Pre-Shared Key(PSK): 1234567890
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Bridge)[Left-Tree] > CA Certificate/CRL[Left-Tree]: Click this tree node and show CA Certificate/Certificate Revocation List(CRL) pane.
- Enter the following.
Certificate/CRL Format: PEM(Base64-encoding) - File
CA Certificates(X.509, *.pem): TestCA-cacert.pem
- VPN Configuration[Tab] > Edit VPN Realm(Save, Add, etc.)[Left-Tree]: Click this tree node and show Edit VPN Realm(Save, Add, Remove, or Load) pane.
- Click Save Configuration button.
- VPN Configuration[Tab] > Edit VPN Realm(Save, Add, etc.)[Left-Tree]: Click this tree node and show Edit VPN Realm(Save, Add, Remove, or Load) pane.
- Click Add VPN Realm button.
Add a VPN Realm[Dialog]:
Enter the following, then click OK button.
Realm ID: 10
Realm Name: "Example VPN"
Description: "Config for Example VPN."
Mode: Remote Client
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Remote Client)[Left-Tree] > Destination[Left-Tree]: Click this tree node and show Destination (Concentrator / Gateway) pane.
- Enter the following.
Destination Address: IPv4 and 10.0.0.1
or
Destination Address: Host Name(FQDN) and gateway1.example.com (Router1's global address)
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Remote Client)[Left-Tree] > My Key Store[Left-Tree]: Click this tree node and show My Key Store pane.
- Enter the following.
Authentication Method: Pre-Shared Key(PSK)
My ID Type: Host Name(FQDN)
My ID: remoteclient1.example.com
Pre-Shared Key(PSK): 1234567890
- VPN Configuration[Tab]
> VPN Realms[Left-Tree]
> 10:Example VPN(Remote Client)[Left-Tree]
> CA Certificate/CRL[Left-Tree]:
Click this tree node and show CA Certificate/Certificate
Revocation List(CRL) pane.
- Enter the following.
Imported Certificate/CRL Format: PEM(Base64-encoding) - File
CA Certificates(X.509, *.pem): TestCA-cacert.pem
- VPN Configuration[Tab]
> Edit VPN Realm(Save, Add, etc.)[Left-Tree]:
Click this tree node and show Edit
VPN Realm(Save, Add, Remove, or Load) pane.
- Click Save Configuration button.
- VPN Configuration[Tab] > Edit VPN Realm(Save, Add, etc.)[Left-Tree]: Click this tree node and show Edit VPN Realm(Save, Add, Remove, or Load) pane.
- Click Add VPN Realm button.
Add a VPN Realm[Dialog]:
Enter the following, then click OK button.
Realm ID: 10
Realm Name: "Example VPN"
Description: "Config for Example VPN."
Mode: Remote Client
- Check Advanced Settings. (Version: 0.2.b1-021 or later)
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Remote Client)[Left-Tree] > VPN Interface[Left-Tree]: Click this tree node and show VPN Tunnel/TAP Interface pane.
- Enter the following.
Internal Address Type: Auto(IKEv2 Configuration)
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Remote Client)[Left-Tree] > Network Interface[Left-Tree]: Click this tree node and show Network Interface pane.
- Check Use default route.
or
- Uncheck Use default route and enter the followings.
Primary interface:
- Name: Select eth0 as a source interface.
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Remote Client)[Left-Tree] > Service[Left-Tree]: Click this tree node and show Service pane.
- Network Deployment: Select Spoke Node/Other.
- Remote Configuration(IKEv2): Select Remote Access Client.
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Remote Client)[Left-Tree] > My Key Store[Left-Tree]: Click this tree node and show My Key Store pane.
- Enter the following.
Authentication Method: Pre-Shared Key(PSK)
My ID Type: Host Name(FQDN)
My ID: remoteclient1.example.com
Pre-Shared Key(PSK): 1234567890
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Remote Client)[Left-Tree] > Peers[Left-Tree]: Click this tree node and show Peers pane.
- Click Add Peer button.
Add a New Peer[Dialog]:
Enter the following, then click OK button.
Peer ID Type: IKEv2: Host Name(FQDN)
Peer ID: gateway1.example.com
- VPN Configuration[Tab]
> VPN Realms[Left-Tree]
> 10:Example VPN(Remote Client)[Left-Tree]
> Peers[Left-Tree] >
gateway1.example.com(FQDN)[Left-Tree]:
Click this tree node and show Peer: gateway1.example.com(FQDN) pane.
- Enter the following.
Peer's IP Address: IPv4 and 10.0.0.1 (Router1's global address)
This peer's Network Deployment: Hub(Concentrator) Node
- VPN Configuration[Tab]
> VPN Realms[Left-Tree]
> 10:Example VPN(Remote Client)[Left-Tree]
> CA Certificate/CRL[Left-Tree]:
Click this tree node and show CA Certificate/Certificate
Revocation List(CRL) pane.
- Enter the following.
Imported Certificate/CRL Format: PEM(Base64-encoding) - File
CA Certificates(X.509, *.pem): TestCA-cacert.pem
- VPN Configuration[Tab]
> Edit VPN Realm(Save, Add, etc.)[Left-Tree]:
Click this tree node and show Edit
VPN Realm(Save, Add, Remove, or Load) pane.
- Click Save Configuration button.