# [NanoBSD] Constant link state changes



## Zoeber (Mar 22, 2010)

Hi,

I hope this hasn't been asek to often, I couldn't find it anywhere here.

I'm running nano bsd on a network appliance with eight Copper and two fiber interfaces. My problem is that - although the fiber interfaces (em8/em9) aren't configured - my /var/log/messages looks as follows:


```
Mar 22 08:01:21 [hostname] kernel: em9: link state changed to DOWN
Mar 22 08:01:22 [hostname] kernel: em9: link state changed to UP
Mar 22 08:01:22 [hostname] kernel: em9: link state changed to DOWN
Mar 22 08:06:22 [hostname] kernel: em9: link state changed to UP
Mar 22 08:06:22 [hostname] kernel: em9: link state changed to DOWN
Mar 22 08:06:22 [hostname] kernel: em9: link state changed to UP
Mar 22 08:11:22 [hostname] kernel: em9: link state changed to DOWN
Mar 22 08:11:22 [hostname] kernel: em9: link state changed to UP
Mar 22 08:11:22 [hostname] kernel: em9: link state changed to DOWN
Mar 22 08:16:23 [hostname] kernel: em9: link state changed to UP
Mar 22 08:16:23 [hostname] kernel: em9: link state changed to DOWN
Mar 22 08:16:23 [hostname] kernel: em9: link state changed to UP
Mar 22 08:16:23 [hostname] kernel: em9: link state changed to DOWN
Mar 22 08:21:23 [hostname] kernel: em9: link state changed to UP
Mar 22 08:21:23 [hostname] kernel: em9: link state changed to DOWN
Mar 22 08:21:23 [hostname] kernel: em9: link state changed to UP
Mar 22 08:21:23 [hostname] kernel: em9: link state changed to DOWN
Mar 22 08:21:23 [hostname] kernel: em9: link state changed to UP
Mar 22 08:21:23 [hostname] kernel: em9: link state changed to DOWN
```

Obviously something happens every five minutes that causes this notification, however the only process that is called every five minutes is `/usr/libexec/atrun`.

The reason this bothers me is because the system is used as a firewall and sends all syslog entries to a central syslog server. We can filter these messages out, but I'd rather correct the problem then make a work-around.

Any ideas what's causing this? Any help would be highly appreciated.
Thanks, Martin


----------



## SirDice (Mar 22, 2010)

Is there anything connected on that interface?

Try forcing it down: `# ifconfig em9 down`.


----------



## Zoeber (Mar 22, 2010)

no, there's nothing connected, not even a fiber module, the slot is empty. The interface is down by default, goes up for a millisecond, and then goes down again. So if i force it down, nothing happens.


----------



## SirDice (Mar 22, 2010)

Sounds like a driver bug or something. The state shouldn't change if nothing is connected.


----------



## Zoeber (Mar 22, 2010)

My thoughts exactly. Thanks for the reply sofar. Interestingly the interface sees a media type:


```
media: Ethernet autoselect (1000baseSX <full-duplex>)
```

even though I don't have an SX module plugged in. The status is also seen as "active", although no cable is plugged in either. Kinda strange.

Any further ideas are still appreciated


----------



## aragon (Mar 22, 2010)

Could well be a hardware bug too...

Do you have something that you can connect to it?  Maybe connecting something will keep it up.


----------



## Zoeber (Mar 22, 2010)

plugging something in would require a fiber-module, which isn't exactly something i have enough of to waste. Besides, I have this problem on several hundred firewalls, so that's not really an option. But thanks for the input.


----------



## SirDice (Mar 22, 2010)

Zoeber said:
			
		

> Besides, I have this problem on several hundred firewalls, so that's not really an option.


Which basically rules out a hardware defect. Unless all those systems have the same hardware defect at the same time. And that's not very likely to happen :e


----------



## richardpl (Mar 22, 2010)

There is sysctl variable to disable logging of interface state changes.


----------



## DutchDaemon (Mar 22, 2010)

Looks like net.inet.ip.check_interface covers them all ...


----------



## SirDice (Mar 22, 2010)

Looking at the numbers I'm guessing `# kldunload if_em` is out of the question :e


----------



## richardpl (Mar 22, 2010)

DutchDaemon said:
			
		

> Looks like net.inet.ip.check_interface covers them all ...



net.link.log_link_state_change


----------



## DutchDaemon (Mar 22, 2010)

richardpl said:
			
		

> net.link.log_link_state_change



Oh, right. Still covers all of them, which may be too big of a hammer for OP.


----------



## Zoeber (Mar 23, 2010)

DutchDaemon said:
			
		

> Oh, right. Still covers all of them, which may be too big of a hammer for OP.



Thanks for the all your help guys, this is exactly what i need. Since the interface states are monitored seperately anyway, i don't really the need link state changes in my logs.

Loving this forum,
Thanks again,
Martin


----------

