6 route -n | awk '$1 == "0.0.0.0" { print $2; exit }'
10 setup_interface_pptp() {
14 config_get device "$config" device
15 config_get ipproto "$config" ipproto
16 config_get server "$cfg" server
18 for module in slhc ppp_generic ppp_async ip_gre; do
19 /sbin/insmod $module 2>&- >&-
23 setup_interface "$device" "$config" "${ipproto:-dhcp}"
26 route delete "$server" 2>/dev/null >/dev/null
27 route add "$server" gw "$gw"
31 config_get netmask "$config" netmask
32 [ -z "$netmask" -o -z "$device" ] || ifconfig $device netmask $netmask
34 # make sure the network state references the correct ifname
36 config_get ifname "$config" ifname
37 uci_set_state network "$config" ifname "$ifname"
39 config_get mtu "$cfg" mtu
41 start_pppd "$config" \
42 pty "/usr/sbin/pptp $server --loglevel 0 --nolaunchpppd" \
43 file /etc/ppp/options.pptp \