L3 OpenVpn тунель

Комментарии ()

Сервер(FreeBSD)

/usr/local/etc/openvpn/server.conf

dev tap
port 7777
#ifconfig 10.7.0.1 10.7.0.2 netmask 255.255.255.252
comp-lzo
daemon
keepalive 10 60
ping-timer-rem
persist-tun
persist-key
secret /usr/local/etc/openvpn/static.key
script-security 2
up /usr/local/etc/openvpn/up.sh

up.sh

#!/bin/sh
/sbin/ifconfig bridge0 addm tap0

/etc/rc.conf

openvpn_enable="YES"
openvpn_configfile="/usr/local/etc/openvpn/server.conf"

Старт

/usr/local/etc/rc.d/openvpn start

 

Клієнт(Ubuntu)

/etc/openvpn/client.conf

dev tap
port 7777

ifconfig 10.15.250.150 255.255.255.0
remote 195.78.38.11
comp-lzo

keepalive 10 60
ping-timer-rem
persist-tun
persist-key
secret /etc/openvpn/static.key
script-security 2
up /etc/openvpn/up.sh

/etc/openvpn/up.sh

#!/bin/sh
route add -net 10.0.0.0/8 gw 10.15.250.1

Запуск

service openvpn@client start

 


Webit.in.ua 2013