# TP-Link TG-3468: random state



## dmtr (Oct 12, 2020)

Hi All!
I use External PCI-Express network card: TP-Link TG-3468 v2 Gigabit Ethernet
on *FreeBSD 11.4-RELEASE-p3.*

/var/run/dmesg.boot

```
re0: <RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet> port 0xe000-0xe0ff mem 0xf7200000-0xf7200fff,0xf0000000-0xf0003fff irq 18 at device 0.0 on pci1
re0: Using 1 MSI-X message
re0: Chip rev. 0x2c000000
re0: MAC rev. 0x00200000
re0: Using defaults for TSO: 65518/35/2048
re0: Ethernet address: 7c:8b:ca:01:a6:eb
```

pciconf -lv

```
re0@pci0:1:0:0: class=0x020000 card=0x34687470 chip=0x816810ec rev=0x06 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller'
    class      = network
    subclass   = ethernet
```

I _noticed_ a *strange* behavior:
`ifconfig re0`

```
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 7c:8b:ca:01:a6:eb
        hwaddr 7c:8b:ca:01:a6:eb
        inet 10.30.0.1 netmask 0xffffff00 broadcast 10.30.0.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
```

Status *active*, but network traffic is empty!
One startup - network Ok, other startup - Bad and so on _randomly_.

I use `arp` and `tcpdump` for analysis.

I _assume_ that the network interface is in the *down* status when it is first enabled.
Because if you do:
`ifconfig re0 down
ifconfig re0 up`
then the network card "_comes to life_".

_I want to understand this random behavior.
And exclude this behavior.
We need stability.

Thank you all!_


----------



## George (Oct 12, 2020)

What is your /etc/rc.conf entry regarding that re interface?


----------



## dmtr (Oct 12, 2020)

This question suggested ..
/etc/rc.conf:
ifconfig_re0="inet 10.30.0.1 netmask 255.255.255.0"
_.. only this._

As _usual_ when configuring the network interface.


----------



## George (Oct 12, 2020)

I think "status: active" means that a LAN cable is plugged in.
You could try ifconfig_re0="DHCP", if you have a DHCP server somewhere.. I am not an expert on this.
FreeBSD Handbook Network Setup


----------



## dmtr (Oct 13, 2020)

DHCP - why?
I specified a static IP.


----------



## dmtr (Oct 13, 2020)

There is another note - *additional* information.
There is a network interface `re1`.
This internal network card, on motheboard.

/var/run/dmesg.boot
re1: <RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet> port 0xc000-0xc0ff mem 0xf7004000-0xf7004fff,0xf7000000-0xf7003fff irq 19 at device 0.0 on pci4
re1: Using 1 MSI-X message
re1: Chip rev. 0x54000000
re1: MAC rev. 0x00100000
re1: Using defaults for TSO: 65518/35/2048
re1: Ethernet address: f8:32:e4:88:51:66

She has a *stable* behavior.
The driver is the *same* - the behavior is different.


----------



## dmtr (Oct 13, 2020)

As for the behavior of `re0` - does not give MAC-address.
The connected active hardware does not see it.
The _Ethernet_ layer does not work.


----------



## monwarez (Oct 13, 2020)

What is the corresponding routing table ?
`netstat -rn`
Also you could give net/realtek-re-kmod a shot (not sure if this card is supported)


----------



## dmtr (Oct 13, 2020)

monwarez said:


> What is the corresponding routing table ?
> `netstat -rn`
> Also you could give net/realtek-re-kmod a shot (not sure if this card is supported)



Ok. I try it.

About _routing_:
If interface is UP `netstat -rn` is:

```
10.30.0.0/24       link#1             U           re0
10.30.0.1          link#1             UHS         lo0
```

If DOWN:

```
10.30.0.1          link#1             UHS         lo0
```

But not *understand* .. i used `tcpdump` .. why need analyse `netstat`?


----------



## monwarez (Oct 13, 2020)

Is that the full output of `netstat -rn` ? I don't see any default route. If the routing table are not setup correctly there will be no packet going throught the interface


----------



## dmtr (Oct 14, 2020)

Hi!
*IP* routing?
The _problem_ is that the network card does not "give" its MAC-address (Ethernet Level).
Even if you include another computer in the network card, *directly*.


----------



## dmtr (Oct 14, 2020)

monwarez said:


> Is that the full output of `netstat -rn` ? I don't see any default route. If the routing table are not setup correctly there will be no packet going throught the interface


Default route _exist_ - direct to another network interface, `tun0`: created after PPPoE connection.
And between `re0` and `re1` exist gateway.

_But what is this information for?_


----------



## dmtr (Oct 14, 2020)

The question _arises_: how do I find out the initial state of the network interface? (After booting the system)


----------



## T-Daemon (Oct 15, 2020)

dmtr said:


> pciconf -lv
> 
> 
> ```
> ...



Try the port kernel driver net/realtek-re-kmod instead of base system re(4).


----------



## dmtr (Nov 5, 2020)

The issue is *resolved*.
The TP-Link network card went into the *trash*.
Replaced it with a D-Link with the same chip.
Works with the standard drivers without the "_tambourine_".


----------

