IP Address command

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

IP Address command

Postby 10fi » Sat Jul 26, 2014 10:50 am

Hi

if I restart my router(including DHCP), the GoFlex goes dark - loses the ip address.
What command should I write to crontab, so I does assign a predefined IP address on a periodic basis ?
10fi
 
Posts: 22
Joined: Tue May 13, 2014 8:06 pm

Re: IP Address command

Postby metalshark » Tue Sep 02, 2014 12:21 am

I am also very interested on this topic. I've been searching frantically and since I'm migrating from Windows (ugghh)... Linux/Unix commands are somewhat very difficult for me to understand. ME <--- TOTAL NOOB!
metalshark
 
Posts: 21
Joined: Tue Sep 02, 2014 12:17 am

Re: IP Address command

Postby haiku » Wed Sep 03, 2014 6:26 am

Hi,
I haven't test it yet
$this->bbcode_second_pass_code('', '
#!/bin/sh
# cron script for checking lan connectivity
# change 192.168.1.1 to whatever IP you want to check.
IP_FOR_TEST="192.168.1.1"
PING_COUNT=1
FFLAG="/opt/lanteststuck.fflg"

ping -c $PING_COUNT $IP_FOR_TEST > /dev/null 2> /dev/null
if [ $? -ge 1 ]
then
if [ -e $FFLAG ]
then
echo "eth0 is still down, REBOOT to recover ..."
rm -f $FFLAG 2>/dev/null
#reboot
else
echo "eth0 seems to be down, trying to bring it up..."
touch $FFLAG
ip link set dev eth0 down
sleep 5
ip link set dev eth0 up
fi
else
echo "eth0 is up"
rm -f $FFLAG 2>/dev/null
fi
')
haiku
 
Posts: 96
Joined: Tue May 31, 2011 6:34 am

Re: IP Address command

Postby WarheadsSE » Wed Sep 03, 2014 2:37 pm

I would suggest just turning in the use of ifplugd, or it's ilk. Thus, if the network connection drops, it will ask for a new address. Now, if the router goes bye bye, but the switch it is on does not, then you have another issue. But then, dhcp should be turning around and re-checking after lease expiration anyways.

And how do you know it is losing it's IP ?
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: IP Address command

Postby haiku » Wed Sep 03, 2014 2:57 pm

I don't know much about ifplugd, how should i test if DHCP lease is ok or not ? Just a systemctl enable ifplugd@eth0.service is enough ?
It happen that my router restart, reassign IP but leave my plugs in 'nowhere' :?
haiku
 
Posts: 96
Joined: Tue May 31, 2011 6:34 am

Re: IP Address command

Postby WarheadsSE » Wed Sep 03, 2014 3:29 pm

netctl-ifplugd@ works for ethernet, as the wiki points out.

Define "nowhere"
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: IP Address command

Postby haiku » Wed Sep 03, 2014 4:00 pm

netctl-ifplugd is loaded by default. About nowhere, I mean that when my router restart, it reassign an IP to my PC and other android devices but it dosen't give automatically any IP to my ALARM plugs.
I just needs to physically remove/reconnect the eth cord, Thanks :)
haiku
 
Posts: 96
Joined: Tue May 31, 2011 6:34 am


Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 3 guests