Solved Gigabit NIC connects at 100Mb

balanga

Daemon

Thanks: 93
Messages: 2,314

#1
I'm running a computer with a Realtek rtl8111 Gigabit network controller. On FreeBSD 11.1 it connects at 100Mb. Using Linux Mint on the same system it connects at 1000Mb.

Are there any magic incantations I need to give FreeBSD to connect at the higher rate?
 

tingo

Daemon

Thanks: 339
Messages: 1,856

#2
No, it should just work. Are there anything interesting in the log files about this re network chip or the connection? Or even in the verbose logs?
 

Snurg

Aspiring Daemon

Thanks: 326
Messages: 794

#3
Look at the ifconfig output, particularly the media field.
If you aren't satisfied with that, use man to learn which media types the driver supports.
Then change that to your liking, using ifconfig.
 
OP
OP
B

balanga

Daemon

Thanks: 93
Messages: 2,314

#5
In Debian linux, gigabyte speeds require the installation of realtek firmware. Without the firmware, it functions at 100mbps.
rtl8111 is also a FreeBSD issue: Thread 55861
Actually, I'm not sure if it is an RTL8111 or RTL8168....

This is from lspci -nn (all on Ubuntu):-
Code:
01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 06)
ifconfig enp1s0
Code:
enp1s0    Link encap:Ethernet  HWaddr 50:af:73:1e:a8:7d 
          inet addr:192.168.1.71  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: 2a01:113f:40e3:8200:cd06:8907:1a63:a943/64 Scope:Global
          inet6 addr: fe80::b235:f878:76b8:31d2/64 Scope:Link
          inet6 addr: 2a01:113f:40e3:8200:7d2c:33e2:4cec:4828/64 Scope:Global
          inet6 addr: 2a01:113f:40e3:8200:d4e8:54b9:e54:bc86/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:169578 errors:0 dropped:0 overruns:0 frame:0
          TX packets:68376 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:73848614 (73.8 MB)  TX bytes:9275001 (9.2 MB)

dmesg |grep enp1s0

Code:
[   17.105748] r8169 0000:01:00.0 enp1s0: renamed from eth0
[   81.561281] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready
[   81.685188] r8169 0000:01:00.0 enp1s0: link down
[   81.685378] IPv6: ADDRCONF(NETDEV_UP): enp1s0: link is not ready
[   81.711404] r8169 0000:01:00.0 enp1s0: link down
[   83.282606] r8169 0000:01:00.0 enp1s0: link up
[   83.479161] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready
Strange that it does not display connection speed.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 6,426
Messages: 27,742

#6
Yeah, one of my pet peeves with Linux, ifconfig doesn't show anything. Use ethtool to see what the connection speed is.
 
OP
OP
B

balanga

Daemon

Thanks: 93
Messages: 2,314

#7
Look at the ifconfig output, particularly the media field.
If you aren't satisfied with that, use man to learn which media types the driver supports.
Then change that to your liking, using ifconfig.
ifconfig
Code:
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
   options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
   ether 50:af:73:1e:a8:7d
   hwaddr 50:af:73:1e:a8:7d
   inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
   nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
   media: Ethernet autoselect (100baseTX <full-duplex>)
   status: active
dmesg
Code:
re0: <RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet> port 0xe000-0xe0ff mem 0xd0304000-0xd0304fff,0xd0300000-0xd0303fff irq 16 at device 0.0 on pci1
re0: Using 1 MSI-X message
re0: Chip rev. 0x2c800000
re0: MAC rev. 0x00100000
miibus0: <MII bus> on re0
rgephy0: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 1 on miibus0
rgephy0:  none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow
re0: Using defaults for TSO: 65518/35/2048
re0: Ethernet address: 50:af:73:1e:a8:7d
re0: netmap queues/slots: TX 1/256, RX 1/256
How do I use man to learn which media types the driver supports?
And how do I tell which driver is being used?
 

Snurg

Aspiring Daemon

Thanks: 326
Messages: 794

#8
Regarding your questions, the logs you posted appear to answer them already.
What does happen when you utter this at the console as root?

Code:
ifconfig re0 media 1000baseT
 
OP
OP
B

balanga

Daemon

Thanks: 93
Messages: 2,314

#9
In Debian linux, gigabyte speeds require the installation of realtek firmware. Without the firmware, it functions at 100mbps.
rtl8111 is also a FreeBSD issue: Thread 55861
I had a look through but got lost after about 30 posts... the last one said:
New driver version 1.93 seems to include patches required for FreeBSD 11.
..so I'm not sure what to make of that.
In my searches I came acrossrsu(4)() which seems like the sort of thing I'm looking for...

I didn't realise that Realtek NICs were such a PITA.
 

Snurg

Aspiring Daemon

Thanks: 326
Messages: 794

#11
The issue with the firmware is old.
This was already common with their first ethernet cards.
I had to preboot in DOS to put the card into a NE2000 mode, so I could boot it afterwards with being recognized by ***x.
I guess you will avoid Realtek in future, too :)

Regarding the <no carrier> :
Please make sure that the device on the other end of the cable is also in 1000T mode.
Some devices and network cards show by LED color whether 100 or 1000 mode.
Maybe you have to pull the cable for a short moment to make the device recheck what kind of connection.
 
OP
OP
B

balanga

Daemon

Thanks: 93
Messages: 2,314

#12
I guess you will avoid Realtek in future, too :)
I didn't realise I had a Realtek NIC. I had heard about their reputation but this is the first time I have had first hand experience of using them. I bought a used Lenovo IdeaCentre Q180, and have always used Lenovo (ex-IBM) and they seem to have always used Intel NICs so am a little surprised with what I got.
 

Snurg

Aspiring Daemon

Thanks: 326
Messages: 794

#13
I hope it works now?
If it does, you might have to add the media option in the ifconfig_re0=... line in /etc/rc.conf to have this permanent.

Selling them in used PCs is always a good way to get rid of them :beer:
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 6,426
Messages: 27,742

#14
Auto-config (speed/duplex) is mandatory on gigabit networks. Setting it to 1000Mbps just won't work at all.

I've had many issues with Realtek network cards. Some worked, some didn't, some where dodgy. The ones that worked performed like crap. A few years ago I had enough of it and bought a bunch of cheap Intel Pro 1000 cards. Never looked back.
 
OP
OP
B

balanga

Daemon

Thanks: 93
Messages: 2,314

#15
How do I identify the exact Realtek NIC I have and which device driver and version number is used by FreeBSD and where should I look for a possible update?
This is what I see when running dmesg :-
Code:
re0: <RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet> port 0xe000-0xe0ff mem 0xd0304000-0xd0304fff,0xd0300000-0xd0303fff irq 16 at device 0.0 on pci1
re0: Using 1 MSI-X message
re0: Chip rev. 0x2c800000
re0: MAC rev. 0x00100000
miibus0: <MII bus> on re0
rgephy0: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 1 on miibus0
rgephy0:  none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow
re0: Using defaults for TSO: 65518/35/2048
re0: Ethernet address: 50:af:73:1e:a8:7d
re0: netmap queues/slots: TX 1/256, RX 1/256
How else can I glean any more info about my NIC?
 
OP
OP
B

balanga

Daemon

Thanks: 93
Messages: 2,314

#17
pciconf -lv
Code:
re0@pci0:1:0:0:   class=0x020000 card=0x363c17aa chip=0x816810ec rev=0x06 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller'
    class      = network
    subclass   = ethernet
 
OP
OP
B

balanga

Daemon

Thanks: 93
Messages: 2,314

#19
I booted up my Lenovo ThinkCentre Q180 today with a different LAN cable today and....
Code:
media: Ethernet autoselect (1000baseTX <full-duplex>)
   status: active
Sorted!!! The end of another wild goose chase...:)
 
Top