Trough the LEAF configuration menu type 1 to access to the network
configuration menu and 1 again to edit your /etc/network/interfaces
file. Enter the following information:
# Loopback interface. auto lo iface lo inet loopback # Declare the internal interface # auto eth0 iface eth0 inet static address 192.168.1.254 masklen 24 broadcast 192.168.1.255 # Declare the external (ppp) interface auto ppp0 iface ppp0 inet ppp pre-up startadsl provider eagle post-down stopadsl
In this /etc/network/interfaces
file the lo,
ppp0 and eth0 interfaces are brought up automatically when the
ifup -a statement is executed at boot time by the
/etc/init.d/networking
script.
The "iface ppp0 inet ppp" section defines the external
address of the router. When the ifup ppp0 command is
executed, it first execute the /usr/sbin/startadsl
script then it executes the pon eagle command which
brings up the ppp0 interface. The startadsl
script is
the following:
#!/bin/sh if [ `pidof pppd` ] ; then logger "ppp connection seems already started!" exit fi # Check if usbdevfs is mounted. If not mount it [ "$(mount | grep 'usbdevfs')" ] || mount -t usbdevfs none /proc/bus/usb sleep 2 [ "$(showstat | grep 'operational')" ] || adictrl -d # Wait for modem "operational" state: adictrl -s # Get the ADI network interface name: INTERFACE=`adictrl -i` # Configure the ADI network interface: ip link set $INTERFACE up
When the ifdown ppp0 command is executed, the
poff eagle command is executed then the
stopadsl
script. The stopadsl
script looks like:
#!/bin/sh # Get the ADI network interface name: INTERFACE=`adictrl -i` # Remove the ADI network interface: ip link set $INTERFACE down
The "iface eth0 inet static" defines the internal address of the router.
Backup the etc.lrp package.