]>
git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/initscripts/init.d/net/red/pppoe
2 ########################################################################
3 # Begin $network_devices/services/pppoe
5 # Description : PPPoE Script
7 # Authors : Michael Tremer - mitch@ipfire.org
13 ########################################################################
17 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/ppp
/settings
)
21 boot_mesg
"Bringing up the PPPoE interface on ${1}..."
22 ip addr add
1.1.1.1/24 broadcast
1.1.1.255 dev
${1}
24 if [ "${METHOD}" != "PPPOE_PLUGIN" ]; then
25 PPPCOMMAND
="/usr/sbin/pppd pty"
26 PPPOECOMMAND
="/usr/sbin/pppoe -p /var/run/pppoe.pid -I ${1} -T 80 -U -m 1412"
27 if [ -n ${SERVICENAME} ]; then
28 PPPOECOMMAND
+=" -S ${SERVICENAME}"
30 if [ -n ${CONCENTRATORNAME} ]; then
31 PPPOECOMMAND
+=" -C ${CONCENTRATORNAME}"
34 if [ "${DNS}" == "Automatic" ]; then
38 if [ "${AUTH}" == "pap" ]; then
40 elif [ "${AUTH}" == "chap" ]; then
44 if [ "${RECONNECTION}" != "persistent" ]; then
45 if [ "${TIMEOUT}" != "0" ]; then
46 SECONDS
=$
[${TIMEOUT} * 60]
47 ARGS
+=" idle ${SECONDS}"
49 if [ "${RECONNECTION}" == "dialondemand" ]; then
50 touch /var
/ipfire
/red
/dial-on-demand
51 ARGS
+=" demand nopersist connect /bin/true"
53 DEMAND
+=" active-filter outbound and not icmp[0] == 3 and not tcp[13] & 4 != 0"
56 ARGS
+=" noipdefault default-asyncmap defaultroute hide-password local mtu ${MTU}"
57 ARGS
+=" mru ${MRU} noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp"
58 ARGS
+=" user ${USERNAME} lcp-echo-interval 20 lcp-echo-failure 3 lcp-max-configure 50"
59 ARGS
+=" maxfail ${MAXRETRIES}"
61 if [ "${DEBUG}" == "on" ]; then
65 $PPPCOMMAND "${PPPOECOMMAND}" $ARGS $DEMAND >/dev
/null
2>&1
68 echo $PID > /var
/run
/ppp-ipfire.pid
72 PPPCOMMAND
="/usr/sbin/pppd plugin rp-pppoe.so ${1}"
73 if [ "${DNS}" == "Automatic" ]; then
74 PPPCOMMAND
+=" usepeerdns"
77 if [ "${AUTH}" == "pap" ]; then
79 elif [ "${AUTH}" == "chap" ]; then
83 if [ "${RECONNECTION}" != "persistent" ]; then
84 if [ "${TIMEOUT}" != "0" ]; then
85 SECONDS
=$
[${TIMEOUT} * 60]
86 PPPCOMMAND
+=" idle ${SECONDS}"
88 if [ "${RECONNECTION}" == "dialondemand" ]; then
89 touch /var
/ipfire
/red
/dial-on-demand
90 PPPCOMMAND
+=" demand nopersist"
92 DEMAND
+="active-filter outbound and not icmp[0] == 3 & not tcp[13] & 4 != 0"
95 PPPCOMMAND
+=" noipdefault defaultroute hide-password ipcp-accept-local"
96 PPPCOMMAND
+=" ipcp-accept-remote passive noccp nopcomp novjccomp"
97 PPPCOMMAND
+=" user ${USERNAME} lcp-echo-interval 20 lcp-echo-failure 3"
98 PPPCOMMAND
+=" lcp-max-configure 50 maxfail ${MAXRETRIES}"
100 if [ "${DEBUG}" == "on" ]; then
104 $PPPCOMMAND $DEMAND >/dev
/null
2>&1
107 echo $PID > /var
/run
/ppp-ipfire.pid
113 boot_mesg
"Bringing down the PPPoE interface on ${1}..."
115 modprobe
-r pppoe
>/dev
/null
2>&1
116 kill $
(cat /var
/run
/pppd-ipfire.pid
)
118 ip addr del
1.1.1.1/24 broadcast
1.1.1.255 dev
${1}
124 echo "Usage: ${0} [interface] {up|down}"
129 # End $network_devices/services/pppoe