Static IP configuration missing when interface is down

Hi all:

I have a very strange issue since a lot of time. I have two laptops with a similar configuration (most of it was copied from one to another). The problem is when I configure an static IP in the em0 interface of both laptops via /etc/rc.conf or manually in the console.

If the laptops are not connected one to another via em0, I need to type the command twice to be effective:

laptop a: ifconfig em0 inet 192.168.58.1/24

laptop b: ifconfig em0 inet 192.168.58.101/24

after configuring the em0 in both laptops I connect the cable between them and everything works

If I disconnect the cable the static IP configuration is lost

If I configure manually the static IPs with the cable connected I cannot get them to work.... it seems similar to when I disconnect the cable, the system detect the interface is down and remove the static configuration.

But I don't see any configuration in /etc/rc.conf that can lead to this behavior. The static IPs should remain configured always, despite of the interfaces are up or down...

What do you think I'm doing wrong? or some clue to find the anomalous configuration in my laptops?

Thanks in advance,

Jes
 
Hi:

Attached my rc.conf in one of the laptops.

Thanks,

Jes
 

Attachments

  • rc.conf
    9.7 KB · Views: 64
Do you have any rules in /etc/devd for interface (em0) for up/down script (LINK_UP/LINK_DOWN)?
In your rc.conf you have hostname variable at line 1 and line 211
 
Code:
ifconfig_pflog0="SYNCDHCP"
Why are you doing this?

You also have a wlan1 and wlan2 interface doing DHCP. Those might end up on the same network, do not put more than one interface on a subnet. You're going to mess up routing that way.

Code:
ifconfig_tun0="SYNCDHCP"
Mentioned twice. But no further configuration of tun0, what's this interface supposed to do?

Code:
ifconfig_bastille0="inet 10.0.1.2 netmask 255.255.255.0"
ifconfig_bastille0="inet 10.0.0.254 netmask 255.255.255.0"
The second overrules the first. And there's no need for an IP address here anyway.

Code:
hald_enable="YES"
polkit_enable="YES"
Useless, remove them.
 
doesn't ifconfig, by default, only show the interfaces that are up? ifconfig -a shows all interfaces, regardless of up/down state?
 
doesn't ifconfig, by default, only show the interfaces that are up? ifconfig -a shows all interfaces, regardless of up/down state?
It does on certain Linux distributions, yes. Not on FreeBSD, the -a is the default.
 
  • Like
Reactions: mer
Do you have any rules in /etc/devd for interface (em0) for up/down script (LINK_UP/LINK_DOWN)?
In your rc.conf you have hostname variable at line 1 and line 211
Hi:

No, any rule regarding em0 or something related to network interfaces.

Fixed the hostname duplication... thanks.
 
Code:
ifconfig_pflog0="SYNCDHCP"
Why are you doing this?

You also have a wlan1 and wlan2 interface doing DHCP. Those might end up on the same network, do not put more than one interface on a subnet. You're going to mess up routing that way.

Code:
ifconfig_tun0="SYNCDHCP"
Mentioned twice. But no further configuration of tun0, what's this interface supposed to do?

Code:
ifconfig_bastille0="inet 10.0.1.2 netmask 255.255.255.0"
ifconfig_bastille0="inet 10.0.0.254 netmask 255.255.255.0"
The second overrules the first. And there's no need for an IP address here anyway.

Code:
hald_enable="YES"
polkit_enable="YES"
Useless, remove them.

ifconfig_pflog0="SYNCDHCP" ... yes, a stupid thing... probably result of search/replace ifconfig ocurrences or something like that in the past... fixed now, thanks

tun0 is for openvpn interface device... probably is not needed... comented.

bastille0... right... fixed as well

hald and polkit removed

And after polishing a little bit more the /etc/rc.conf file... everything works as before... the em0 doesn't maintain its configuration when the cable is connected between the two laptops and the other side is not configured (no IP) ... the only way it works is to asign manually the IPs to the interfaces without the cable... and the connect the cable when they're configured... in this way the link goes up and the connectivity is ok.

Another test... if I configure the static IP in /etc/rc.conf then the laptops retain that configuration if the cable is not connected (when rebooting or executing /etc/netstart ) ... if reboot/netstart is done without cable then yes, the em0 maintain the IP...

Thanks for your help..

BR
 
The conclusion of yours doesn't help to diagnose the cause of the issue that you have. Please share the output of the ifconfig when you experience the problem and also the result when you try to manually set the IP address when the cable is connected using ifconfig inet 192.168.58.1/24 for host A and ifconfig inet 192.168.58.101/24 for host B then share again the result of the ifconfig and the arp table apr -a

During all of the tests disable the firewall and test the connectivity using ping
 
Back
Top