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

Re: LASAT ifupdown support



Hi Brian,

On Wed, 19 Feb 2003, Brian Murphy wrote:

> Here is a patch which adds direct support for the lasat proc
> interface to the eeprom stored network configuration to ifupdown.
>[..]
> auto eth0
> iface eth0 inet lasat
>     gateway 10.0.0.1
>[..]
>
> Anyway I hope this is useful to someone. I like it very much.

It find it useful, especially if it works on an alias which I guess it
will (that way you can set it up to always have the EEPROM address as
eth0:0 so you can always contact the box if you forgot the IP. Apart from
being useful, it is definitely cool :)

The broadcast problem could be solved with a perl script:

-- broadcast.pl --

#! /usr/bin/perl

($a,$b,$c,$d) = split(/\./,$ARGV[0]);
$ip = $a*256*256*256 + $b*256*256 + $c*256 + $d;
($a,$b,$c,$d) = split(/\./,$ARGV[1]);
$mask = $a*256*256*256 + $b*256*256 + $c*256 + $d;

$bc = $ip & $mask | ~$mask;

print "".(($bc>>24)&0xff).".".(($bc>>16)&0xff).".".(($bc>>8)&0xff).".".($bc&0xff)."\n";

-- snip --

then just use broadcast=`broadcast.pl $ipaddr $netmask`

cheers,
Thomas



Reply to: