Commit 1c621d43 authored by Adam Wujek's avatar Adam Wujek 💬

rootfs: fix problems with setting static IP

Fix problem when IP address was set via dhcp then as static.
Second problem was that udhcpc wasn't able to get IP when interface was put down just
before its start.
Signed-off-by: Adam Wujek's avatarAdam Wujek <>
parent 39ebdf6c
......@@ -21,8 +21,11 @@ fi
# kill all previous instances of udhcpc
killall udhcpc &> /dev/null
# put eth0 down in case it was up before
ifdown eth0 &> /dev/null
# put eth0 down in case it was up before, flush to aviod ifup complains
ip addr flush dev eth0
ip link set eth0 down
# wait after down to make udhcpc to work properly
sleep 1
if [ "$CONFIG_ETH0_STATIC" ] || [ "$CONFIG_ETH0_DHCP_ONCE" ]; then
echo "Write IP address"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment