Odd behaviour with AutoIP and Static IP #68238
-
Hi all On my device, I would like to be able to switch between a static IP and DHCP. In case there is no DHCP response, AutoIP should be used. I am trying to understand how this works together with setting a static IP. *** Booting Zephyr OS build zephyr-v3.4.0 ***
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Run ipv4 autoconf client with static IP
[00:00:00.001,000] <wrn> net_ipv4_autoconf_sample: Startup:
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Slot: 1 of 2
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Your address: 79.110.214.51
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Subnet: 44.194.72.198
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Type: static
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Slot: 2 of 2
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Your address: 19.148.87.2
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Subnet: 44.194.72.198
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Type: static -> Both slots seem to have odd addresses and net masks. Maybe this is simply the default? -> Next I set a static IP (address=192.168.2.100 and mask=255.255.255.0). [00:00:00.001,000] <wrn> net_ipv4_autoconf_sample: Configuring static IP... Then I read out the config again: [00:00:00.001,000] <wrn> net_ipv4_autoconf_sample: After setting the static IP:
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Slot: 1 of 2
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Your address: 192.168.2.100
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Subnet: 255.255.255.0
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Type: static
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Slot: 2 of 2
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Your address: 0.0.0.0
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Subnet: 255.255.255.0
[00:00:00.001,000] <inf> net_ipv4_autoconf_sample: Type: static -> Slot 1 got configured as expected. Slot 2 kind of gets disabled ( -> After a while, AutoIP kicks in and changes both slots: [00:00:12.320,000] <wrn> net_ipv4_autoconf_sample: After net mgmt event:
[00:00:12.320,000] <inf> net_ipv4_autoconf_sample: Slot: 1 of 2
[00:00:12.320,000] <inf> net_ipv4_autoconf_sample: Your address: 192.168.2.100
[00:00:12.320,000] <inf> net_ipv4_autoconf_sample: Subnet: 255.255.0.0
[00:00:12.320,000] <inf> net_ipv4_autoconf_sample: Type: static
[00:00:12.320,000] <inf> net_ipv4_autoconf_sample: Slot: 2 of 2
[00:00:12.320,000] <inf> net_ipv4_autoconf_sample: Your address: 169.254.209.13
[00:00:12.320,000] <inf> net_ipv4_autoconf_sample: Subnet: 255.255.0.0
[00:00:12.320,000] <inf> net_ipv4_autoconf_sample: Type: static -> Slot 2 now has an AutoIP which is ok. It also changed its netmask to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It is not the network interface that get increased but the number of unicast IPv4 addresses that can be assigned to the network interface.
Looks like some garbage values when no address have been set yet.
There is currently a limitation that we can only have one netmask for the network interface. So you are basically just printing the same value twice. We do not have proper IP routing implemented atm in zephyr, but if you have only one network interface, then things should work. |
Beta Was this translation helpful? Give feedback.
It is not the network interface that get increased but the number of unicast IPv4 addresses that can be assigned to the network interface.
Looks like some garbage values when no address have been set yet.
There is currently a limitation that we can only have one netmask for the network interface. So you are basically just printing the …