IPsec/IKEv2-based VPN software for Linux
Setup a physical interface.
# sudo ifconfig eth0 192.168.0.10 netmask 255.255.255.0 # sudo route add default gw 192.168.0.1 # sudo sysctl net.ipv4.ip_forward=1 |
Setup physical interfaces.
eth0 and a default route are configured according to your ISP's instructions. # sudo ifconfig eth1 192.168.1.10 netmask 255.255.255.0 Enable IPv4 routing. # sudo sysctl net.ipv4.ip_forward=1 |
Setup physical interfaces.
eth0 and a default route are configured according to your ISP's instructions. # sudo ifconfig eth1 192.168.2.10 netmask 255.255.255.0 Enable IPv4 routing. # sudo sysctl net.ipv4.ip_forward=1 |
# sudo ifconfig eth0 10.0.0.1 netmask 255.255.255.0
# sudo ifconfig eth1 192.168.0.1 netmask 255.255.255.0 Enable IPv4 routing. # sudo sysctl net.ipv4.ip_forward=1 Forward packets destinated to 10.0.0.1:500(Router1) to 192.168.0.10:500(HubGw). # sudo iptables -t nat -A PREROUTING -p udp --dst 10.0.0.1 --dport 500 -j DNAT --to-destination 192.168.0.10:500 Forward packets destinated to 10.0.0.1:4500(Router1) to 192.168.0.10:4500(HubGw). # sudo iptables -t nat -A PREROUTING -p udp --dst 10.0.0.1 --dport 4500 -j DNAT --to-destination 192.168.0.10:4500 |
auto eth0
iface eth0 inet static address 192.168.0.10 network 192.168.0.0 netmask 255.255.255.0 broadcast 192.168.0.255 gateway 192.168.0.1 |
- 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: Router
- VPN Configuration[Tab]
> VPN Realms[Left-Tree]
> 10:Example VPN(Router)[Left-Tree]
> VPN Interface[Left-Tree]:
Click this tree node and show VPN Tunnel/TAP Interface pane.
- Enter the following. This address is for the virtual interface rhpvif10.
Internal Address Type: Static Address
Internal IPv4 Address: 192.168.100.1
Netmask: 255.255.255.248
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Router)[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 eth0 as a source interface.
- VPN Configuration[Tab]
> VPN Realms[Left-Tree]
> 10:Example VPN(Router)[Left-Tree]
> Service[Left-Tree]:
Click this tree node and show Service pane.
- Network Deployment: Select Hub(Concentrator) Node.
- VPN Configuration[Tab]
> VPN Realms[Left-Tree]
> 10:Example VPN(Router)[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
Imported Key Format: PKCS#12 - File
PKCS#12 file(*.p12): gateway1.example.com.p12
RSA Private Key's Password: himitsu
- VPN Configuration[Tab]
> VPN Realms[Left-Tree]
> 10:Example VPN(Router)[Left-Tree]
> Internal Route Map[Left-Tree]:
Click this tree node and show Internal Route Map pane.
- Click Add Route button.
Add a New Internal Route[Dialog]:
Enter the following routing entry
to the Site1,
then click OK button.
Destination IPv4 Network(*): 192.168.1.0
Netmask(*): 255.255.255.0
Forwarding Type(*): Gateway IPv4 Address
Forward to(*): 192.168.100.2
Destination IPv4 Network(*): 192.168.2.0
Netmask(*): 255.255.255.0
Forwarding Type(*): Gateway IPv4 Address
Forward to(*): 192.168.100.3
- 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: Router
- VPN Configuration[Tab]
> VPN Realms[Left-Tree]
> 10:Example VPN(Router)[Left-Tree]
> VPN Interface[Left-Tree]:
Click this tree node and show VPN Tunnel/TAP Interface pane.
- Enter the following. This address is for the virtual interface rhpvif10.
Internal Address Type: Static Address
Internal IPv4 Address: 192.168.100.2
Netmask: 255.255.255.248
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Router)[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 eth0 as a source interface.
- VPN Configuration[Tab]
> VPN Realms[Left-Tree]
> 10:Example VPN(Router)[Left-Tree]
> Service[Left-Tree]:
Click this tree node and show Service pane.
- Network Deployment: Select Spoke Node / Client / Other.
- VPN Configuration[Tab]
> VPN Realms[Left-Tree]
> 10:Example VPN(Router)[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
Imported Key Format: PKCS#12 - File
PKCS#12 file(*.p12): spoke1.example.com.p12
RSA Private Key's Password: himitsu
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Router)[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(Router)[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 IPv4 Address: 10.0.0.1 (Router1's global address)
This peer's Network Deployment: Hub(Concentrator) Node
Always-on connection: Check Enabled.
- VPN Configuration[Tab]
> VPN Realms[Left-Tree]
> 10:Example VPN(Router)[Left-Tree]
> Internal Route Map[Left-Tree]:
Click this tree node and show Internal Route Map pane.
- Click Add Route button.
Add a New Internal Route[Dialog]:
Enter the following routing entry
to the Site0,
then click OK button.
Destination IPv4 Network(*): 192.168.0.0
Netmask(*): 255.255.255.0
Forwarding Type(*): Gateway IPv4 Address
Forward to(*): 192.168.100.1
Destination IPv4 Network(*): 192.168.2.0
Netmask(*): 255.255.255.0
Forwarding Type(*): Gateway IPv4 Address
Forward to(*): 192.168.100.3
- 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: Router
- VPN Configuration[Tab]
> VPN Realms[Left-Tree]
> 10:Example VPN(Router)[Left-Tree]
> VPN Interface[Left-Tree]:
Click this tree node and show VPN Tunnel/TAP Interface pane.
- Enter the following. This address is for the virtual interface rhpvif10.
Internal Address Type: Static Address
Internal IPv4 Address: 192.168.100.3
Netmask: 255.255.255.248
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Router)[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 eth0 as a source interface.
- VPN Configuration[Tab]
> VPN Realms[Left-Tree]
> 10:Example VPN(Router)[Left-Tree]
> Service[Left-Tree]:
Click this tree node and show Service pane.
- Network Deployment: Select Spoke Node / Client / Other.
- VPN Configuration[Tab]
> VPN Realms[Left-Tree]
> 10:Example VPN(Router)[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
Imported Key Format: PKCS#12 - File
PKCS#12 file(*.p12): spoke2.example.com.p12
RSA Private Key's Password: himitsu
- VPN Configuration[Tab] > VPN Realms[Left-Tree] > 10:Example VPN(Router)[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(Router)[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 IPv4 Address: 10.0.0.1 (Router1's global address)
This peer's Network Deployment: Hub(Concentrator) Node
Always-on connection: Check Enabled.
- VPN Configuration[Tab]
> VPN Realms[Left-Tree]
> 10:Example VPN(Router)[Left-Tree]
> Internal Route Map[Left-Tree]:
Click this tree node and show Internal Route Map pane.
- Click Add Route button.
Add a New Internal Route[Dialog]:
Enter the following routing entry
to the Site0,
then click OK button.
Destination IPv4 Network(*): 192.168.0.0
Netmask(*): 255.255.255.0
Forwarding Type(*): Gateway IPv4 Address
Forward to(*): 192.168.100.1
Destination IPv4 Network(*): 192.168.1.0
Netmask(*): 255.255.255.0
Forwarding Type(*): Gateway IPv4 Address
Forward to(*): 192.168.100.2
- 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.