Set the dynamic IP, and after a while, use ifconfig to check, but no IP, subnet mask, or gateway were found

ifconfig eth0 192.168.120.2 netmask 255.255.0.0,ifconfig as follows

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.120.2 netmask 255.255.0.0 broadcast 192.168.255.255
inet6 fe80::4bbd:c578:e47:ea5c prefixlen 64 scopeid 0x20
ether 48:b0:2d:5a:61:12 txqueuelen 1000 (Ethernet)
RX packets 252 bytes 12314 (12.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15786 bytes 22579189 (22.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 37

after a while, ifconfig as follows

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::4bbd:c578:e47:ea5c prefixlen 64 scopeid 0x20
ether 48:b0:2d:5a:61:12 txqueuelen 1000 (Ethernet)
RX packets 260 bytes 12872 (12.8 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 19718 bytes 28284175 (28.2 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 37

Why are the IP, subnet mask, and gateway settings not displayed?

If a disconnect of the cable is detected, then the address goes away. Also, DHCP periodically renews, and if the renewal fails due to the router, the IP will also go away. Key to knowing is to log via “dmesg --follow”, and show what occurs when lost. If you don’t know when this occurs, just wait till the issue hits, then create a dmesg log. Example:
dmesg 2>&1 | log_dmesg.txt

Incidentally, disconnect is not necessarily a cable disconnect. This can include any electrical event, such as too much noise, which results in the signal quality going down too much.

How to detect the occurrence of this situation caused by a decrease in signal quality,thanks

You cannot directly see signal quality without a hardware network analyzer. The dmesg logs should provide hints though. Different network states log to that, and although it isn’t explicit about signal quality, there might be something to confirm or deny different failures.

The dmesg displays information about eth0 as follows:
[ 6.341646] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 6.667606] net eth0: get_configure_l3v4_filter →
[ 6.671516] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 8.286369] eqos 2490000.ether_qos eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 8.287013] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 42.660771] eqos 2490000.ether_qos eth0: Link is Down
[ 44.282361] eqos 2490000.ether_qos eth0: Link is Up - 100Mbps/Full - flow control rx/tx

Is your router trying to issue IPv6 addresses? In an earlier ifconfig I see this excerpt:
inet 192.168.120.2

The above is IPv4, which is the most reliable addressing. If something uses IPv6, then all of the software in the chain has to support IPv6. It is possible that something in settings, after some time, is attempting to get an IPv6 address, which in turn would cause the IPv4 address to be lost. Do you have admin access to your router? I would suggest telling it to assign only IPv4 addresses.

The above might not be the issue, but it seems like it must be answered before knowing the next step.

Hello,This device is directly connected to another device, and my goal is to transfer local data to another device through the network. When the device is turned on, it will ifconfig eth0 192.168.120.2 netmask 255.255.0.0, and then start transmitting data. The local IP is dynamically obtained and not set as a static IP, and there is no IPv6 address set. This is to transfer data to devices in different network segments

Is there a switch the device connects to, and then the switch to the Jetson? By “directly connected”, do you instead mean there is no switch, but there is a cable directly from Jetson to device? An example might be a network camera or LIDAR. In order to have DHCP there must be a router or DHCP server somewhere. I need to know exactly where the DHCP server is and how the device and Jetson are wired, including any switch. The reason I am confused is that if a device connects directly to the Jetson’s eth0, and there is no switch, then there can’t be DHCP replies to DHCP requests (the router wouldn’t be able to connect).

Hi, the network port of this Jetson device is directly connected to the network port of another Jetson device, without connecting to switch or router devices

It is the router that provides a dynamic IP address. Without a DHCP server (which is what a router has) you would have to either (A) install your own DHCP server, far more complicated than static addresses, or (B) revert to static IP addresses.

請問一下目前這個討論到底卡在哪裡?

感覺上就是一般的網路設定問題. Jetson在燒完之後就預設是dhcp client
如果拿不到IP, 代表你另外一端DHCP server沒辦法assign IP給Jetson.

A device does not want to be set to static IP because it wants to adapt to B devices in different network segments. Therefore, how to set DHCP for A device. In addition, I set the IP address of device A to static IP (192.168.120.2), but there was an unstable transmission of data. Overall, dynamic IP addresses may experience IP drop issues; Static IP may cause unstable data transmission. How to locate the problem in this situation?

Hi,

看不太懂你所謂的 “it wants to adapt to B devices in different network segments” , 需要你解釋一下你到底想做什麼

我的意思是你最終的設計到底是怎樣連接網路?

另外, 你所提到的問題請拿出log 或是數據證明, 這種敘述說實話沒有太大的幫助 說不定實際情況也不是你說的那樣

Two devices are directly connected to the network, while the IP network segment of the other device (B) is not fixed. In order to communicate with each other, device B will tell device A what IP address to set. Once device A knows, they will use the command ifconfig eth0 IP netmask to set the IP address. The problem I encountered was that after setting it up for a while, when using the ifconfig command to check, the IP and subnet mask were lost
The Jestion device is connected to a device with a network, and when both devices are turned on at the same time, dmesg printing does not have any information about eth0. How can I find relevant evidence
For example, the network port of the Jestion device is directly connected to the network port of the computer, and the information printed by dmesg is
[14860.912195] eqos 249000. ether_quality eth0: Link is Up -1Gbps/Full - flow control rx/tx
[14860.913470] IPv6: ADDRCONF (NETDEV.CHANGE): eth0: link benefits ready
Then I used the ifconfig eth0 IP netmask command to set the IP, but dmesg did not receive any information to print a prompt
After unplugging the network cable, the information printed by dmesg is
Eqos 249000. ether_qos eth0: Link is Down
This information is very obvious

Hi,

我請問一下 你能否用中文講一下你現在的狀況? 可能會比較有效率一點
有幾個地方聽起來還是不太確定你在講什麼

Two devices are directly connected to the network

請問network在這裡是指兩台機器port to port對接還是你接到其他router?

while the IP network segment of the other device (B) is not fixed

我還是不明白你所謂的IP network segment是什麼意思

In order to communicate with each other, device B will tell device A what IP address to set

如果IP根本就還沒設定, 那你device B怎麼告訴device A要設什麼IP?

The Jestion device is connected to a device with a network, and when both devices are turned on at the same time, dmesg printing does not have any information about eth0. How can I find relevant evidence

看不懂你想表達什麼, 為何又突然多一台"device with a network". 所以A跟B沒有對接?

請問有沒有類似block diagram的說明可以解釋一下目前的網路接法?

Sorry, the translation software is not very good

A设备网络和B设备网络是直连(一根网线连接),B的IP网段,A不知道。A要设置成跟B网段一致的ip(能相互ping通,发送数据)。B会告诉A要设置什么IP地址。A设备知道了,将使用命令ifconfig eth0 IP netmask来设置IP地址。我遇到的问题是,在设置了一段时间后,当使用ifconfig命令进行检查时,IP和子网掩码丢失了。以上操作都是程序自动执行的。
具体流程是:B设备先上电,A设备后上电,A拿到B设备想要设置的ip,ifconfig eth0 ip netmask进行设置,等待一段时间,在用ifconfig查看发现ip和netmask没有显示。dmesg打印没有eth0的信息。Jestion设备的网络直接连接到计算机的网络端口,dmesg打印的信息为
[14860.912195] eqos 249000. ether_quality eth0: Link is Up -1Gbps/Full - flow control rx/tx
[14860.913470] IPv6: ADDRCONF (NETDEV.CHANGE): eth0: link benefits ready
ifconfig eth0 IP netmask命令设置IP,dmesg没有任何信息打印
拔下网线后,dmesg打印的信息为
Eqos 249000. ether_qos eth0: Link is Down
这种连接有明显的信息显示

Hi,

如果就是兩台機器對接然後設成static IP.
建議你可以看一下/var/log/syslog 在IP消失那段期間的log 是發生什麼狀況

另外, 你也可以試試看直接用GUI設定兩邊IP然後擺上幾個小時試試看有沒有一樣的狀況

动态ip的情况下能在/var/log/syslog中查看到ip消失吗

請問一下現在到底在用動態IP還是static IP…

上面講的在用靜態IP但你又來問動態IP的事情…

其實這跟syslog能不能看到無關 我只是想確認一下你到底在設定什麼