[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

LASAT ifupdown support



Here is a patch which adds direct support for the lasat proc
interface to the eeprom stored network configuration to ifupdown.

After you apply and compile ifupdown you can add a section
like this to /etc/network/interfaces:

auto eth0                                                                       
iface eth0 inet lasat                                                           
        gateway 10.0.0.1    

Any changes in the network information via service/admin tool
or spconfig are then reflected when you boot into debian :-).

As it is currently written it requires a kernel patch which
creates a proc file for the broadcast address since ifconfig
persists in using IP address classes to calculate the broadcast
address despite the evidence to the contrary in the netmask.
This will be included in my next patch to the linux-mips.org
CVS. If you can live with an incorrect broadcast address then
you can simply remove the references to broadcast address
below. As an alternative perhaps there is someone who knows
a (standard) program which calculates the broadcast address?

Anyway I hope this is useful to someone. I like it very much.

The precompiled package can be downloaded from here:

http://debian.murphy.dk/ifupdown_0.6.4-4_mipsel.deb

/Brian

diff -u ifupdown-0.6.4/inet.defn ifupdown-0.6.4-new/inet.defn
--- ifupdown-0.6.4/inet.defn	2003-01-19 21:58:46.000000000 +0000
+++ ifupdown-0.6.4-new/inet.defn	2003-01-19 20:58:09.000000000 +0000
@@ -108,3 +108,21 @@
   down
     /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \
                       -p /var/run/wvdial.%iface% -s 2
+
+method lasat
+  description
+    this method gets the ip address and netmask via the proc interface to
+    the nvram on lasat boards
+
+  options
+    gateway address             -- Default gateway (dotted quad)
+
+  up
+    ifconfig %iface% `cat /proc/sys/lasat/ipaddr` \
+    	netmask `cat /proc/sys/lasat/netmask` \
+	broadcast `cat /proc/sys/lasat/bcastaddr` up
+    [[ route add default gw %gateway% %iface% ]]
+
+  down
+    ifconfig %iface% down
+    [[ route del default gw %gateway% %iface% ]]



Reply to: