Managing Communication |
Setup 1: Ethernet Bridging for Private Networks on Different Subnets
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
Host A (B) represents one of the machines that belongs to OpenVPN A (B). The two remote subnets are configured for a different range of IP addresses. When this setup is moved to a public network, the external interfaces of the OpenVPN machines should be configured for static IPs, or connect to another device (such as a firewall or DSL box) first.
2.Generate a preset shared key by typing the command:
# openvpn
Copy the file that is generated to the OpenVPN machine.
3.Generate a script file named
#!/bin/sh |
|
iface=ixp1 | # defines the internal interface |
maxtap=`expr 1` # defines the number of tap devices. I.e., # of tunnels
IPADDR=
NETMASK=
BROADCAST=
#it is not a great idea but this system doesn’t support
#
ifcfg_vpn()
{
while read f1 f2 f3 f4 r3 do
if [ “$f1” = “iface”
while : do
if [ $i