# Ethernet puzzler



## Red_Cat (Jul 14, 2011)

I don't think this is a FreeBSD problem but it was encountered as during the setup of a new FreeBSD box. I am a FreeBSD newbie and haven't touched a Unix OS in 15 or more years so I was pretty sure initially that my configuration for the NIC card was flawed. The ethernet LED's showed a connection on the PC and what looked like heavy traffic on the router port. When trying to ping the router, packet loss was about 99%.

After going through the help files and being sure the configuration was correct my focus moved to the NIC card itself, an integrated Pro/100 VE. I had a LinkSys LNE100TX card on hand so threw that in, configured it and had the same result.

I then moved the 60' patch cord to my laptop and got a good connection right away. For some reason I was still suspicious of the cable (CAT-5e) so cut and replaced both ends and even made up a new CAT-5 cable from a different batch all with no change, effectively ruling out the cabling as the source of the problem.

As a last ditch effort I moved the router so the 60' patch cord was between the modem and router with a 4' patch cord from the router to the PC. Works perfectly! Both NIC cards work fine with this arrangement.







What I'm puzzled by is why two out of 4 NIC cards function perfectly at the end of a 60' ethernet connection and the other two refuse to connect. I can't keep the wireless router at that end of the basement as it puts it out of range of the two PCs two floors above. I'm suspicious of the wired connections on the router but hate to buy a new router just to troubleshoot. If anyone has any insight I'd love to hear it!

Conrad


----------



## wblock@ (Jul 14, 2011)

Ideas, in what I'd guess to be the most likely order:

1. Bad autoconfig (duplex mismatch) on the D-Link.
2. Different AC grounds between the router and the systems that don't work.
3. Wiring error on the wire.  Newer cards will automatically correct for that, older ones don't.
4. Configuration problem on the FreeBSD system.
5. Bad switch port on the D-Link.
6. Intermittent/broken conductor in the 60' cable.  Works sometimes due to position of the wire.

#1 test by forcing the FreeBSD system to half-duplex and full-duplex.
#2 test by powering the FreeBSD system from the same outlet as the router, still using the 60' Ethernet cable.
#3 test by swapping the 60' server cable to the FreeBSD system.
#4 test by showing the output of ifconfig on the FreeBSD system.  Or boot with a Linux live CD and see if the 60' Ethernet suddenly works.
#5 test by moving cables around on the D-Link.
#6 is hard to test.  Probably easiest to try another whole Ethernet cable.


----------



## Red_Cat (Jul 14, 2011)

wblock said:
			
		

> Ideas, in what I'd guess to be the most likely order:
> 
> 1. Bad autoconfig (duplex mismatch) on the D-Link.
> 2. Different AC grounds between the router and the systems that don't work.
> ...



Thanks wblock for the reply.

1. I'll have to dig around the Dlink again see what I can find.
2. Easy enough to test.
3. Actually I've been moving the same cable between machines. The server is currently unused so doesn't have a dedicated line. Even though I've put together a couple hundred patch cables over the years I began to doubt my abilities and put about 3 sets of ends on that cable. Even went and bought new cable to rule out a cable defect.
4. I'll post it.
5. Tried all 4 ports - all the same behaviour.
6. See #3 above.

I'm headed out now so I'll address things again in the morning.


----------



## wblock@ (Jul 15, 2011)

For #1, use ifconfig(8) to force the duplex:
`# ifconfig re0 media 100baseTX mediaopt full-duplex`
`# ifconfig re0 media 100baseTX mediaopt half-duplex`


----------



## Red_Cat (Jul 16, 2011)

Did some further checking today.

1. Didn't see anything in the Dlink control panel that looked amiss. I also tried forcing both full and half duplex on the FreeBSD side and saw no change. (I restarted the connection with */etc/rc.d/netif restart* after each change)
2. Ran an extension cord over to the Dlink to ensure that everything was on the same circuit and saw no change in behavior.
3. Checked the pin outs on both cables, the 4' that works and the 60' that doesn't, and they are identical and also no shorts or cross connections.

Here is the output of *ifconfig *when it's working fine on the 4' patch cord:

```
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=2009<RXCSUM,VLAN_MTU,WOL_MAGIC>
	ether 00:11:11:46:17:13
	inet 10.0.0.110 netmask 0xffffff00 broadcast 10.0.0.255
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=3<RXCSUM,TXCSUM>
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4 
	inet6 ::1 prefixlen 128 
	inet 127.0.0.1 netmask 0xff000000 
	nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
```

And when not working with the 60' patch cord:

```
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=2009<RXCSUM,VLAN_MTU,WOL_MAGIC>
	ether 00:11:11:46:17:13
	inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=3<RXCSUM,TXCSUM>
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4 
	inet6 ::1 prefixlen 128 
	inet 127.0.0.1 netmask 0xff000000 
	nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
```

I have it set up to receive as a DHCP client hence no IP when it's not connecting to the Dlink. I have tried giving it a fixed IP but that doesn't make any difference.

My gut says to replace the Dlink. It works well with everything on the 4' patch cord but only some things on the 60' cord. It's just that the things it won't work with at 60' are both attached to the FreeBSD box which would imply something misconfigured there. But if that were the case it shouldn't work with either cable.


----------



## wblock@ (Jul 16, 2011)

Changes made with ifconfig(8) are live, you don't have to restart netif.

Swapping another switch for the D-Link would be a good test.  Worth trying a firmware upgrade and clear-to-factory-settings on it, too.


----------



## Red_Cat (Jul 25, 2011)

*Followup*

Thought I'd post a follow up to let you know the issue is resolved.

I purchased a Netgear router on the theory that the Dlink was the culprit. There was no change - everything worked on the 4' cable, only the laptop and Windows server worked on the 60' cable.

Not wanting to run back and forth to Micro Center I went there and picked up a ready made 75' Cat 6 cable, a 10/100 NIC card and a wireless card to cover the remaining possibilities with the wireless card as fallback.

Hooked up the new cable and walaa - perfect! Checked the pin outs against the two Cat 5e cables that weren't working and they all match. I'm still scratching my head as to what is wrong with the two Cat 5 cables but I'm not dwelling on it, just moving on. The two old cables went in the trash as they don't deserve space around here.

Side note on the wireless card: The card is an ASUS PCI-G31 which isn't listed as supported but was only about $15.00 so what the heck. Even though the ethernet connection was working I decided to install it anyway so I'd have the option of moving the server upstairs where there are no wired connections. The card works well with the *ral(4)* drivers on a WPA-PSK connection.


----------



## Red_Cat (Jul 25, 2011)

Almost forgot - Thanks *wblock *for your help in sorting this!


----------



## wblock@ (Jul 25, 2011)

Glad you got it working!

If the old cables are still available, or you have more of those RJ45s, check them.  There are some that are meant for stranded wire.  From the side, the contacts have little dracula fangs (AFAIR).  They don't work reliably with ordinary solid-conductor wire.  No, that's an understatement: they are frustratingly screwy with ordinary wire.  Sorry I didn't think of that earlier, but I've been trying to suppress that memory for several years now.


----------

