mpd.conf
Код: Выделить всё
startup:
default:
load l2tp
l2tp:
new -i ng0 l2tp L2TP0
set auth authname username
set iface disable on-demand
set iface idle 0
set bundle no multilink
set bundle disable noretry
set link no acfcomp protocomp
set link disable pap chap
set link accept chap
set link keep-alive 15 60
set link max-redial 0
set link mtu 1390
set link mru 1390
set iface up-script /usr/local/etc/mpd4/ng0_up.sh
set iface down-script /usr/local/etc/mpd4/ng0_down.sh
open
Код: Выделить всё
L2TP0:
set phys type l2tp
set l2tp peer 193.251.135.97
set l2tp disable incoming
set l2tp enable originate
Код: Выделить всё
#!/bin/sh
route add 193.251.135.97 10.7.100.1
natd -f /etc/natd.cf -n ng0 -p 1234
ipfw add 150 fwd 10.7.100.1 ip from 10.7.100.6 to not 192.168.199.254/24 via ng0
ipfw add 320 divert 1234 all from any to any via ng0
route change default 192.168.238.238
Код: Выделить всё
iface=$1
kill -9 `ps -ax | grep "natd -f /etc/natd.conf -n $iface" | awk '{ print }'`
ipfw delete 150
ipfw delete 300
route delete 193.251.135.97