Client not receiving a new IPv4 address after router reboot

I’m running a home server with Ubuntu 16.04. Everything is working great with the Omnia, except that after a reboot, I need to dis- and reconnect the server’s RJ45-cable to get the router to give it a new IPv4 address. It seems to be getting an IPv6 address, which it should, but then never an IPv4 one. Apparently, this prevents it from connecting to the internet.

I’ve tried assigning it a static IP through the Omnia, and letting it give it one if its own choosing. Same result either way.

Shouldn’t servers in general have a static ip-address? I mean off course you could have a dynamic ip-address, but you do want to know which ip-address your server is having all the time.

What also is confusing in your comment, you WANT your home server to receive a IPv4 address and yet you do not want a IPv4 address? [quote=“NCLI, post:1, topic:2632”]
I need to dis- and reconnect the server’s RJ45-cable to get the router to give it a new IPv4 address. It seems to be getting an IPv6 address, which it should, but then never an IPv4 one
[/quote]

Please do clarify or i am just reading it wrong.

Have you tried with different devices if it is the same case? Or tried maybe with virtualmachine and tested Ubuntu 16.04 on that. Why i say this is to make sure who is at fault. We might be looking at Omnia, but maybe there would be the possibility that it is Ubuntu 16.04 having a issue with this.

@Big_boss I assume he is referring to static DHCP binding on DHCP server (TO) for MAC address of Ubuntu server.

I got feeling this has something to do with port reconnecting issues:

but I might be wrong as IPv6 works (but I’m not sure if @NCLI tested the IPv6 connectivity or there is just IPv6 address on Ubnutu)

EDIT: @NCLI do you have more clients connected to the TO with the same issue or you have only the Ubuntu server? Could you try to connect something else to check if it’s specific or system wide issue? I mean also try virtualmachine like @Big_boss suggest but also some separate HW on different cable/port in TO - notebook or so

Hi,

I have same problem with IPv4 connectivity inside LAN as @NCLI, originally I thought that I had the same problem with not starting LAN Ports after reboot as mentioned in Swich ports offline if plugged during boot, so I tried to patch it with fix-switch and without result, this reply is also posted in there.

After a while of testing and approximately twenty reboot (both software and hardware), I came to the fact that the ports activated, but DHCP assigns only IPv6 address.

Command dhclient ethXX (or in newer distros dhclient enpXXXX) as well as disconnection and reconnection of the cable ensures IPv4 address.

Here are ifconfig outputs for network states after omnia reboot
rebooting omnia:
enp0s25 Link encap:Ethernet HWadr f0:de:f1:2e:14:b4
AKTIVOVÁNO VŠESMĚROVÉ_VYSÍLÁNÍ MULTICAST MTU:1500 Metrika:1
RX packets:567044 errors:0 dropped:6 overruns:0 frame:0
TX packets:237771 errors:0 dropped:0 overruns:0 carrier:0

omnia back online:
enp0s25 Link encap:Ethernet HWadr f0:de:f1:2e:14:b4
inet6-adr: fd1b:da9b:9280::2ac/128 Rozsah:Globál
inet6-adr: fe80::4a1:7c7e:94ba:ff3c/64 Rozsah:Linka
inet6-adr: fd1b:da9b:9280:0:4729:3d35:76a5:c93a/64 Rozsah:Globál
AKTIVOVÁNO VŠESMĚROVÉ_VYSÍLÁNÍ BĚŽÍ MULTICAST MTU:1500 Metrika:1
RX packets:567109 errors:0 dropped:6 overruns:0 frame:0
TX packets:237869 errors:0 dropped:0 overruns:0 carrier:0

after dhclient command execution:
enp0s25 Link encap:Ethernet HWadr f0:de:f1:2e:14:b4
inet adr:192.168.10.102 Všesměr:192.168.10.255 Maska:255.255.255.0
inet6-adr: fd1b:da9b:9280::2ac/128 Rozsah:Globál
inet6-adr: fe80::4a1:7c7e:94ba:ff3c/64 Rozsah:Linka
inet6-adr: fd1b:da9b:9280:0:4729:3d35:76a5:c93a/64 Rozsah:Globál
AKTIVOVÁNO VŠESMĚROVÉ_VYSÍLÁNÍ BĚŽÍ MULTICAST MTU:1500 Metrika:1
RX packets:567372 errors:0 dropped:6 overruns:0 frame:0
TX packets:238047 errors:0 dropped:0 overruns:0 carrier:0

And now I’m not sure if Omnia assigns only IPv6 addresses and IPv4 after reconnection or dhclient request, or my computers (running Lubuntu 16.04) just accept IPv6 as enough and “not bother” with fact that IPv6 is useless in my network, windows not tested yet.
Problem is that I don’t know how to determine which scenario is correct but when reconnection or issuing dhclient command solves problem I think that Omnia for some reason provides only IPv6 config.

I’m thinking about setting server’s ssh to listen also on IPv6 and placing ssh command for server (ssh server ‘dhclient eth0’) in Omnia startup script but there is several security problems:

  1. Command dhclient needs sudo or root access but it’s qite dificult to use sudo through ssh inline command and moreover sudo needs my password (=place plaintext password inside omnia) or enable root login to my server. So NO and NO NEVER…
  2. Less painful but also not ideal situation is tied to first problem - Omnia needs ssh key to passwordless login to my server. I know that Omnia without major OS modifications is (or should be) much more safe device than my PC or server but I don’t like to place password unprotected ssh key in it.

As I wrote that problems with Omnia controlling server so I think that only good direction is force server to run dhclient on its own.
Please is here someone able to create some ligtweight script to monitor network interface and run dhclient when only IPv6 address is available?

So finaly I had found simple bash script that should be used with cron to check and restore IPv4 connection after Omnia reboot.
Maybe it’s not elegant script but it works…

Here is script that is placed here: /usr/local/bin/ipv4_reset
#!/bin/bash
x=ping -c 1 YOU.RRO.UTE.RIP>&1 | grep unreachable

if [ ! "$x" = "" ]
        then
                dhclient enp3s0
fi

“enp3s0” shoud be replaced by your lan interface name to make this usefull.

and here line from /etc/crontab used to run network check every two minutes

*/2 * * * * root /usr/local/bin/ipv4_reset

Have you updated the router to TurrisOS 3.5.2? That release had fixes for the switch ports not coming up consistently at reboot and did fix that problem for me.

I have TurisOS 3.5.2 but my problem isn’t that ports not came up after reboot.
All ports come up but devices, at least these runing on Linux, connected by wire just get only IPv6 address (no matter that they have static IP assigned in DHCP configuration) what is in my network quite useless. So I found this workaround and it looks functional.

Odd, I have linux hosts and Macs wired directly to the Turris Omnia, they get ipv4 and ipv6 addresses correctly via DHCP (for the ipv4 case) without any unusual interventions.