Moxa UC-8416-T-LX [44/90] Openvpn

Moxa UC-8416-T-LX [44/90] Openvpn
UC-8410/8416/8418/8430 Managing Communication
4-17
OpenVPN
OpenVPN provides two types of tunnels for users to implement VPNS: Routed IP Tunnels and Bridged
Ethernet Tunnels. To begin with, check to make sure that the system has a virtual device /dev/net/tun. If
not, issue the following command:
# mknod /dev/net/tun c 10 200
An Ethernet bridge is used to connect different Ethernet networks together. The Ethernets are bundled into one
bigger, logicalEthernet. Each Ethernet corresponds to one physical interface (or port) that is connected to the
bridge.
On each OpenVPN machine, you should generate a working directory, such as /etc/openvpn, where script
files and key files reside. Once established, all operations will be performed in that directory.
Setup 1: Ethernet Bridging for Private Networks on Different Subnets
1. Set up four machines, as shown in the following diagram.
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.
# openvpn --genkey --secret secrouter.key
Copy the file that is generated to the OpenVPN machine.
2. The openvpn-bridge script file located at /etc/openvpn/reconfigures the interface eth1as IP-less,
creates logical bridge(s) and TAP interfaces, loads modules, and enables IP forwarding.
#---------------------------------Start-----------------------------
#!/bin/sh
iface=eth1 # 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
# /etc/sysconfig/network-scripts/ifcfg-eth1
ifcfg_vpn()

Содержание

Скачать