IPsec/IKEv2-based VPN software for Linux
# sudo ifconfig eth0 192.168.0.100 netmask 255.255.255.0
# sudo route add default gw 192.168.0.10 |
192.168.100.1 samba1.example.com |
# sudo ifconfig eth0 10.0.0.1 netmask 255.255.255.0
# sudo ifconfig eth1 192.168.0.10 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.100:500(VPN Gateway). # sudo iptables -t nat -A PREROUTING -p udp --dst 10.0.0.1 --dport 500 -j DNAT --to-destination 192.168.0.100:500 Forward packets destinated to 10.0.0.1:4500(Router1) to 192.168.0.100:4500(VPN Gateway). # 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 Enable IPv4 routing. # sudo sysctl net.ipv4.ip_forward=1 Exec NAPT for packets from private network(192.168.2.0/24). # sudo iptables -t -nat -A POSTROUTING -o eth0 -j MASQUERADE --random |
auto eth0
iface br0 inet static address eth0.168.0.100 network 192.168.0.0 netmask 255.255.255.0 gateway 192.168.0.10 broadcast 192.168.0.255 |
- 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: End Node
- 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: Static Address
Internal IPv4 Address: 192.168.100.1
Netmask: 255.255.255.0
- 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.
- Select eth0 to establish VPN.
- 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 Spoke Node/Other.
- Remote Configuration(IKEv2): Select Remote Configuration Server.
- EAP Server: Select EAP-MSCHAPv2.
- Default EAP Server: Check Enable.
- 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.100.20 - 192.168.100.30
- 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.1
- 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
Imported Key Format: PKCS#12 - File
PKCS#12 file(*.p12): vpnserver1.example.com.p12
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: EAP-MSCHAPv2: User Name
Peer ID: alice
Pre-Shared Key(PSK)/Password: 1234567890
- 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.
10.0.0.1 vpnserver1.example.com # (Example VPN)
|