# NIC enabled as half duplex



## apolinsky (May 14, 2010)

I have an older Dell machine with a motherboard integrated NIC. When Freebsd8 boots up, the NIC is enabled as half duplex. The machine was previously running Slackware Linux, where the NIC was full duplex. Can I set some configuration in rc.conf to force full duplex?

Thank you.

Alan


----------



## kdemidofff (May 14, 2010)

did u assign ip address to it? if u don't it seems not initialize proper media


----------



## apolinsky (May 14, 2010)

The address is assigned by a Slackware server running dhcp.It gets the address fine. I can get on the internet without any problems.

Alan


----------



## phoenix (May 14, 2010)

Double-check the switch settings, to make sure the switch is not in half-duplex mode.

You can use ifconfig() to set the duplex (see the *mediaopts* section).  However, if you set it on the NIC, be sure to set it on the switch, or you'll get duplex-mismatch errors.


----------



## apolinsky (May 15, 2010)

Thank you for your suggestion. Obviously, if when the same machine connects to a switch using Linux and it connects as full duplex, the switch is not the problem. I had read up that I could force the connection to be be full duplex with the ifconfig command, but I was hoping there would be some configuration I could set in rc.conf. I guess I'll stick with ifconfig.


Alan


----------



## Beastie (May 15, 2010)

Well, you can use *mediaopt full-duplex* in /etc/rc.conf. I'm not sure you can use it with DHCP though.

```
ifconfig_dev0="DHCP media 100baseTX mediaopt full-duplex"
```

You can always use static IP addresses instead if it doesn't work, no?


----------



## phoenix (May 15, 2010)

You can also use two entries:

```
ifconfig_dev0="media 100baseTX mediaopt full-duplex"
ifconfig_dev0_alias0="DHCP"
```


----------



## jalla (May 15, 2010)

It's worth noting that autonegotiate doesn't work the way most people expect. The important part is *negotiate*; it requires that both sides actively try to agree on the settings. Further, according to the standard, if autoneg fails the interface shall fallback to half-duplex (!)

That leads to some interresting (and to many, counterintuitive) effects. If for instance your switchport is set to full-duplex and the host use the default of auto, you're guaranteed a duplex mismatch.


----------

