Moxa Technologies UC-7420/7410 user manual Setup 3 Routed IP

Models: UC-7420/7410

1 106
Download 106 pages 2.64 Kb
Page 75
Image 75

UC-7420/7410 User’s Manual

Managing Communication

Setup 3: Routed IP

1.Set up four machines as shown in the following diagram:

Host A

eth0: 192.168.2.171

eth0: 192.168.4.172

local net

OpenVPN A

eth1: 192.168.2.173

eth0: 192.168.8.173

Internet

ixp0: 192.168.8.174

ixp1: 192.168.4.174

Host B

local net

OpenVPN B

2.Create a configuration file named “A-tun.conf” and an executable script file named “A-tun.sh”.

#point to the peer remote 192.168.8.174 dev tun

secret /etc/openvpn/secrouter.key cipher DES-EDE3-CBC

auth MD5 tun-mtu 1500 tun-mtu-extra 64 ping 40

ifconfig 192.168.2.173 192.168.4.174 up /etc/openvpn/A-tun.sh

#---------------------------------

Start-----------------------------

#!/bin/sh

 

#value after “-net” is the subnet behind the remote peer route add -net 192.168.4.0 netmask 255.255.255.0 gw $5

#---------------------------------

end ------------------------------

Create a configuration file named B-tun.confand an executable script file named B-tun.shon OpenVPN B:

remote 192.168.8.173 dev tun

secret /etc/openvpn/secrouter.key cipher DES-EDE3-CBC

auth MD5 tun-mtu 1500 tun-mtu-extra 64 ping 40

ifconfig 192.168.4.174 192.168.2.173 up /etc/openvpn/B-tun.sh

#---------------------------------

Start----------------------------

#!/bin/sh

 

#value after “-net” is the subnet behind the remote peer route add -net 192.168.2.0 netmask 255.255.255.0 gw $5

#---------------------------------

end -----------------------------

4-23

Page 75
Image 75
Moxa Technologies UC-7420/7410 user manual Setup 3 Routed IP