2006-09-23 21:01:51 +03:00
|
|
|
scan_pptp() {
|
2006-07-30 06:09:09 +03:00
|
|
|
scan_ppp "$@"
|
|
|
|
}
|
|
|
|
|
2006-09-23 21:01:51 +03:00
|
|
|
setup_interface_pptp() {
|
2006-07-30 06:09:09 +03:00
|
|
|
local config="$2"
|
2007-08-30 19:53:22 +03:00
|
|
|
local ifname
|
2006-07-30 06:09:09 +03:00
|
|
|
|
|
|
|
config_get device "$config" device
|
2007-08-27 19:37:37 +03:00
|
|
|
config_get ipproto "$config" ipproto
|
2006-07-30 06:09:09 +03:00
|
|
|
|
|
|
|
for module in slhc ppp_generic ppp_async ip_gre; do
|
|
|
|
/sbin/insmod $module 2>&- >&-
|
|
|
|
done
|
2007-08-30 19:53:22 +03:00
|
|
|
sleep 1
|
|
|
|
|
|
|
|
setup_interface "$device" "$config" "${ipproto:-dhcp}"
|
|
|
|
|
|
|
|
# fix up the netmask
|
|
|
|
config_get netmask "$config" netmask
|
|
|
|
[ -z "$netmask" -o -z "$device" ] || ifconfig $device netmask $netmask
|
|
|
|
|
|
|
|
# make sure the network state references the correct ifname
|
|
|
|
scan_ppp "$config"
|
|
|
|
config_get ifname "$config" ifname
|
2008-02-03 08:48:15 +02:00
|
|
|
uci_set_state network "$config" ifname "$ifname"
|
2006-07-30 06:09:09 +03:00
|
|
|
|
|
|
|
config_get mtu "$cfg" mtu
|
2006-09-23 21:01:51 +03:00
|
|
|
config_get server "$cfg" server
|
2006-07-30 06:09:09 +03:00
|
|
|
mtu=${mtu:-1452}
|
|
|
|
start_pppd "$config" \
|
2007-04-21 23:19:54 +03:00
|
|
|
pty "/usr/sbin/pptp $server --loglevel 0 --nolaunchpppd" \
|
|
|
|
file /etc/ppp/options.pptp \
|
2006-09-23 21:01:51 +03:00
|
|
|
mtu $mtu mru $mtu
|
2006-07-30 06:09:09 +03:00
|
|
|
}
|