]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/initscripts/init.d/networking/red
pppsetup: add atm device selection.
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / networking / red
old mode 100755 (executable)
new mode 100644 (file)
index e28b2e6..e0c66b6
@@ -22,6 +22,7 @@
 #Define some defaults
 INET_VLAN=7
 IPTV_VLAN=8
+ATM_DEV=0
 
 eval $(/usr/local/bin/readhash /var/ipfire/main/settings)
 if [ "$RRDLOG" == "" ]; then
@@ -170,11 +171,19 @@ case "${1}" in
 
 
                        if [ "$TYPE" == "pppoeatm" ] || [ "$TYPE" == "pptpatm" ]; then
-                               PPP_NIC=nas0            
-                               DEVICE=nas0
+                               PPP_NIC=nas${ATM_DEV}
+                               DEVICE=nas${ATM_DEV}
                                boot_mesg "Createing ATM-Bridge as $PPP_NIC ..."
-                               br2684ctl -c0 -e${ENCAP} -a0.${VPI}.${VCI} >/dev/null 2>&1 &
+                               br2684ctl -c${ATM_DEV} -e${ENCAP} -a${ATM_DEV}.${VPI}.${VCI} >/dev/null 2>&1 &
                                sleep 1
+
+                               # use user-defined or green mac address for nas0
+                               if [ -n "$MAC" ]; then
+                                       ip link set dev nas${ATM_DEV} address ${MAC}
+                               else
+                                       ip link set dev nas${ATM_DEV} address $(cat /sys/class/net/green0/address)
+                               fi
+
                                if [ "$TYPE" == "pppoeatm" ]; then
                                        TYPE="pppoe"
                                fi
@@ -388,10 +397,18 @@ case "${1}" in
                        ### Standard PPP options we always use
                        #
                        PPP_STD_OPTIONS="$PLUGOPTS $DNS defaultroute noipdefault noauth"
-                       PPP_STD_OPTIONS+=" default-asyncmap hide-password nodetach mtu ${MTU}"
-                       PPP_STD_OPTIONS+=" mru ${MRU} noaccomp nodeflate nopcomp novj novjccomp"
+                       PPP_STD_OPTIONS+=" default-asyncmap hide-password nodetach"
+                       PPP_STD_OPTIONS+=" noaccomp nodeflate nopcomp novj novjccomp"
                        PPP_STD_OPTIONS+=" nobsdcomp user ${USERNAME} lcp-echo-interval 20"
                        PPP_STD_OPTIONS+=" lcp-echo-failure 5 ${AUTH}"
+
+                       if [ -n "${MTU}" ]; then
+                               PPP_STD_OPTIONS="${PPP_STD_OPTIONS} mtu ${MTU}"
+                       fi
+
+                       if [ -n "${MRU}" ]; then
+                               PPP_STD_OPTIONS="${PPP_STD_OPTIONS} mru ${MRU}"
+                       fi
                                
                        ### Debugging
                        #