ThinkCore W311/321/341 Linux User’s Manual Managing Communications
4-31
5. On each OpenVPN machine, check the routing table by typing the command:
# route
Destination Gateway Genmsk Flags Metric Ref Use Iface
192.168.4.0 * 255.255.255.0 U 0 0 0 br0
192.168.2.0 * 255.255.255.0 U 0 0 0 br0
192.168.8.0 * 255.255.255.0 U 0 0 0 eth0
Interface eth1 is connected to the bridging interface br0, to which device tap0 also connects,
whereas the virtual device tun sits on top of tap0. This ensures that all traffic from internal
networks connected to interface eth1 that come to this bridge write to the TAP/TUN device
that the OpenVPN program monitors. Once the OpenVPN program detects traffic on the
virtual device, it sends the traffic to its peer.
6. To create an indirect connection to Host B from Host A, you need to add the following routing
item:
route add –net 192.168.4.0 netmask 255.255.255.0 dev eth0
To create an indirect connection to Host A from Host B, you need to add the following routing
item:
route add –net 192.168.2.0 netmask 255.255.255.0 dev eth0
Now ping Host B from Host A by typing:
ping 192.168.4.174
A successful ping indicates that you have created a VPN system that only allows authorized
users from one internal network to access users at the remote site. For this system, all data is
transmitted by UDP packets on port 5000 between OpenVPN peers.
7. To shut down OpenVPN programs, type the command:
# killall -TERM openvpn
1. Set up four machines as shown in the following diagram:
OpenVPN A
OpenVPN B
Host A
LAN1: 192.168.2.171
Host B
LAN1: 192.168.4.172
LAN1: 192.168.8.174
LAN1: 192.168.2.173
local net
local net
InternetInternet
LAN2: 192.168.4.174
LAN2: 192.168.8.173