# Why is hub required on host to host connection?



## Bill Evans at Mariposa (Nov 30, 2016)

In the past I've had two Linux hosts; call them tiger and apteryx. Host tiger has a network interface connected to a DSL modem; no problems there. Host tiger has another network interface, with a cable running directly from that interface to host apteryx's only interface; that connection is host apteryx's only link to the outside world. Up to now, no problems.

The problem arises when I install FreeBSD (11.0-RELEASE-p1) on host tiger. Its connection to the DSL modem remains fully functional. But host tiger can't talk with host apteryx any more. `ifconfig(8)` shows these relevant details:

```
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
        ether 00:0e:0c:c4:62:8c
        inet 10.0.1.1 netmask 0xffffff00 broadcast 10.0.1.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (none)
        status: no carrier
```
So as an experiment, instead of using a simple cable from host tiger to host apteryx, I replace it with a simple hub, and connect both hosts to that hub. Now everything works as it should, and `ifconfig(8)` shows:

```
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
        ether 00:0e:0c:c4:62:8c
        inet 10.0.1.1 netmask 0xffffff00 broadcast 10.0.1.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (10baseT/UTP <half-duplex>)
        status: active
```
My question: Is there a way I can lose the hub, keep the functionality with a simple cable, and make the connection great again? Is there some `ifconfig(8)` command (for example) that user root can use?


----------



## kpa (Nov 30, 2016)

It depends on hardware but generally you can just use whatever cable you happen to have between the systems and it will work fine. The exceptions are the older network cards that can't either auto-negotiate duplex or do require that you use a cross-over cable instead of a straight cable if there's no hub (really a hub? I haven't seen a hub since the late '90s) or a switch in between.

It looks like you have such older system and the NIC is an fxp(4) one, it definitely needs a crossover cable if you want to connect it to another system directly with just one cable.


----------



## Bill Evans at Mariposa (Nov 30, 2016)

Yes. Really a hub. Went upstairs and pulled it out of a Zip-Loc bag. No configuration necessary, of course. Sometimes simple is good.

I had thought that perhaps there would be a software solution to this problem, because under Linux the connection with an ordinary cable works just fine. So hub it is. Ah well.


----------



## kpa (Nov 30, 2016)

As far as I remember fxp(4) has a history on FreeBSD of being rather ill behaved NIC because of certain limitations of the hardware, maybe Linux has been able to cope with those better. If it's just two computers connected to each other a hub is not going to be bottleneck but if you ever decide to extend the network you should get a cheap switch, you can get a five port gigabit switch for about $30 now.


----------



## phoenix (Nov 30, 2016)

Swap out the patch cable for a cross-over cable and everything will probably just work again.  Sounds like an update to the driver removed the ability to sense a host-to-host connection and configure the NIC for cross-over (auto-MDI-X).  Which is why you need the hub in the middle to do the conversion.


----------



## Bill Evans at Mariposa (Nov 30, 2016)

phoenix said:


> Swap out the patch cable for a cross-over cable and everything will probably just work again.


Sounds like a plan, except that I don't yet have a crossover cable and I already have a hub. It's kinda cool for the grandkids to see the green lights on the hub flicker when there's traffic. :)

/down with emojis
//ascii art for the win


----------



## Terry_Kennedy (Dec 1, 2016)

phoenix said:


> Sounds like an update to the driver removed the ability to sense a host-to-host connection and configure the NIC for cross-over (auto-MDI-X).  Which is why you need the hub in the middle to do the conversion.


I think it was a switch from Linux to FreeBSD that changed things.

Some of the EtherExpress chips support auto-MDIX. Here is an Intel application note for the 82551 family describing the function. Here is a quote from a different document explaining why it is normally disabled on motherboards: _"The reason that Auto-MDI-X is disabled by default is that Ethernet devices on motherboards are typically classified as MDI equipment, whereas routers and switches are classified as MDI-X equipment. It is standard for MDI-X equipment to manage auto switching rather than MDI equipment."_ Note that as long as _either_ end supports auto-MDI-X, the link will come up.


----------

