diff options
author | Ermal Luçi <eri@pfsense.org> | 2010-03-08 19:58:59 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2010-03-08 19:58:59 +0000 |
commit | 768f4c0e8766829893583b58e8b2cb5527397ae5 (patch) | |
tree | c162662c1201850b4108999dc636e5593b8fd7a6 /etc | |
parent | 23f0ca50d2543a9725840147f9484fbd40345c77 (diff) | |
download | pfsense-768f4c0e8766829893583b58e8b2cb5527397ae5.zip pfsense-768f4c0e8766829893583b58e8b2cb5527397ae5.tar.gz |
Enable mpd5 for pppoe/pptp client connections. It brings improvements with it.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/interfaces.inc | 115 |
1 files changed, 45 insertions, 70 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index b660646..fc9b6e2 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -2030,7 +2030,8 @@ EOD; } $mpdconf .= <<<EOD - new -i {$realif} pppoeclient pppoeclient + create bundle static {$interface} + set iface name {$realif} EOD; if ($interface == "wan") @@ -2062,8 +2063,25 @@ EOD; } } + if (isset($config['system']['dnsallowoverride'])) { + $mpdconf .= <<<EOD + set ipcp enable req-pri-dns + +EOD; + } + + if (!isset($wancfg['dnsnosec']) && isset($config['system']['dnsallowoverride'])) { + $mpdconf .= <<<EOD + set ipcp enable req-sec-dns + +EOD; + } + $mpdconf .= <<<EOD - set bundle disable multilink + set ipcp yes vjcomp + set ipcp ranges 0.0.0.0/0 0.0.0.0/0 + create link static {$interface}L1 pppoe + set link action bundle {$interface} set auth authname "{$wancfg['pppoe_username']}" set auth password "{$wancfg['pppoe_password']}" set link keep-alive 10 60 @@ -2071,6 +2089,8 @@ EOD; set link no acfcomp protocomp set link disable pap chap set link accept chap + set pppoe iface {$wancfg['if']} + set pppoe service "{$wancfg['provider']}" EOD; if (empty($wancfg['mtu'])) @@ -2080,25 +2100,9 @@ EOD; $mpdconf .= <<<EOD set link mtu {$mpdmtu} - set ipcp yes vjcomp - set ipcp ranges 0.0.0.0/0 0.0.0.0/0 EOD; - if (isset($config['system']['dnsallowoverride'])) { - $mpdconf .= <<<EOD - set ipcp enable req-pri-dns - -EOD; - } - - if (!isset($wancfg['dnsnosec']) && isset($config['system']['dnsallowoverride'])) { - $mpdconf .= <<<EOD - set ipcp enable req-sec-dns - -EOD; - } - $mpdconf .= <<<EOD open @@ -2107,26 +2111,6 @@ EOD; fwrite($fd, $mpdconf); fclose($fd); - /* generate mpd.links */ - $fd = fopen("{$g['varetc_path']}/mpd_{$interface}.links", "w"); - if (!$fd) { - printf("Error: cannot open mpd_{$interface}.links in interface_pppoe_configure().\n"); - return 1; - } - - $mpdconf = <<<EOD -pppoeclient: - set link type pppoe - set pppoe iface {$wancfg['if']} - set pppoe service "{$wancfg['provider']}" - set pppoe enable originate - set pppoe disable incoming - -EOD; - - fwrite($fd, $mpdconf); - fclose($fd); - if(file_exists("{$g['varrun_path']}/pppoe_{$interface}.pid") and $g['booting']) { /* if we are booting and mpd has already been started then don't start again. */ } else { @@ -2195,7 +2179,8 @@ EOD; } $mpdconf .= <<<EOD - new -i {$realif} pptp pptp + create bundle static {$interface} + set iface name {$realif} EOD; if ($interface == "wan") @@ -2219,8 +2204,24 @@ EOD; EOD; } + if (isset($config['system']['dnsallowoverride'])) { + $mpdconf .= <<<EOD + set ipcp enable req-pri-dns + +EOD; + } + + if (!isset($wancfg['dnsnosec']) && isset($config['system']['dnsallowoverride'])) { + $mpdconf .= <<<EOD + set ipcp enable req-sec-dns + +EOD; + } + $mpdconf .= <<<EOD - set bundle disable multilink + set ipcp no vjcomp + set ipcp ranges 0.0.0.0/0 0.0.0.0/0 + create link static {$interface}L1 pptp set auth authname "{$wancfg['pptp_username']}" set auth password "{$wancfg['pptp_password']}" set bundle no noretry @@ -2229,17 +2230,11 @@ EOD; set link no acfcomp protocomp set link disable pap chap set link accept chap - set ipcp no vjcomp - set ipcp ranges 0.0.0.0/0 0.0.0.0/0 - -EOD; - if (isset($config['system']['dnsallowoverride'])) { - $mpdconf .= <<<EOD - set ipcp enable req-pri-dns + set pptp self {$wancfg['local']} + set pptp peer {$wancfg['remote']} + set pptp disable windowing EOD; - } - $mpdconf .= <<<EOD open @@ -2248,26 +2243,6 @@ EOD; fwrite($fd, $mpdconf); fclose($fd); - /* generate mpd.links */ - $fd = fopen("{$g['varetc_path']}/mpd_{$interface}.links", "w"); - if (!$fd) { - printf("Error: cannot open mpd_{$interface}.links in interface_pptp_configure().\n"); - return 1; - } - - $mpdconf = <<<EOD -pptp: - set link type pptp - set pptp enable originate outcall - set pptp disable windowing - set pptp self {$wancfg['local']} - set pptp peer {$wancfg['remote']} - -EOD; - - fwrite($fd, $mpdconf); - fclose($fd); - /* configure interface */ if($wancfg['if']) mwexec("/sbin/ifconfig " . escapeshellarg($wancfg['if']) . " " . @@ -2275,7 +2250,7 @@ EOD; else log_error("Could not bring interface wancfg['if'] up in interface_pptp_configure()"); /* fire up mpd */ - mwexec("/usr/local/sbin/mpd4 -b -d {$g['varetc_path']} -f mpd_{$interface}.conf -l mpd_{$interface}.links -p {$g['varrun_path']}/pptp_{$interface}.pid pptp"); + mwexec("/usr/local/sbin/mpd5 -b -d {$g['varetc_path']} -f mpd_{$interface}.conf -p {$g['varrun_path']}/pptp_{$interface}.pid pptp"); return 0; } |