如何刷新本地IP地址?

如何刷新本地IP地址?

如何刷新ip anear 命令上显示的当前本地 IP 地址inet?问题是,有时我连接交换机的电缆,然后 IP 会发生变化。

它似乎发生了变化,因为每当我将其连接到交换机时,我就无法再 ssh 了(超时)

*该交换机实际上是我用作交换机的旧路由器

答案1

ssh user_name@host_name.local忘记用来连接名为 的机器的IP host_name。它将解决您的 IP 更改问题。

MacUser2525:~$ alias pi
alias pi='ssh [email protected]'
MacUser2525:~$ pi
Linux buster-raspi 5.9.0-0.bpo.5-arm64 #1 SMP Debian 5.9.15-1~bpo10+1 (2020-12-31) aarch64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Feb 18 01:31:30 2021 from fe80::1003:5492:80fa:2bc5%eth0
zeus@buster-raspi:~$

相关内容