El vie, 04-01-2013 a las 14:18 +0100, Jo-Philipp Wich escribió:

> > ifdown br-wan and ifup br-wan do nothing since i don't have them
> > as interfaces in /etc/config/networking/
> 
> Use ifup wan / ifdown wan, not br-wan.
> The if* commands refer to the logical interface names ("lan", "wan",
> "loopback") not the physical ones - also ifup implies ifdown.
> 
> ~ Jow


Ok, that seems to solve it. Stupid me was trying ifdown eth0.2

Somehow I quickly read radio0.network1 and I confused it with "wlan"
instead of "wan" ...  (O//o) :shame:

Many Thanks !

PS:

Here is the script for the interested. If someone wants to improve this
gibberish feel free!

#!/bin/sh
oldip==`ifconfig br-wan | sed -n -e 's/.*inet addr:\([0-9]*\.[0-9]*
\.[0-9]*\.[0-9]*\)\ .*/\1/p'`
echo "Old ip was $oldip"
oldsubnet=`ifconfig br-wan | sed -n -e 's/.*inet addr:\([0-9]*\.[0-9]*
\)\..*/\1/p'`
echo "Old subnet is $oldsubnet"
number=$(awk 'BEGIN{srand(); print int(255 * rand()) }')
sleep 1
number2=$(awk 'BEGIN{srand(); print int(255 * rand()) }')
pid=`pidof udhcpc`; /bin/kill -SIGUSR2 $pid
udhcpc -r "$oldsubnet.$number.$number2" -i br-wan
newip==`ifconfig br-wan | sed -n -e 's/.*inet addr:\([0-9]*\.[0-9]*
\.[0-9]*\.[0-9]*\)\ .*/\1/p'`
echo "New ip was $newip"
ifup wan
exit

If you do not want to store it in your config you can obviously call it
like

#!/bin/bash
ssh 192.168.1.1 -l root 'sh -s' < /home/martin/bin/open-wrt/script.bash
exit

and use a password-less key for automation
_______________________________________________
openwrt-users mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-users

Reply via email to