如何知道网络路由器分配给我知道其名称的另一台计算机的IP地址?

时间:2018-07-26 07:51:08

标签: unix ip ip-address router hostname

我需要在笔记本电脑.bashrc中使用export ROS_MASTER_URI=http://<ip changing every 12hours of another workstation belonging to the same network>:11311,为此,我发现了这篇文章:https://unix.stackexchange.com/questions/20784/how-can-i-resolve-a-hostname-to-an-ip-address-in-a-bash-script

这正是我从中得到的内容,给了我一些ip:getent hosts <hostname of the workstation, basically the name at the beginning of every line in the workstation's shell, e.g : user@hostname:~$ ...> | awk '{ print $1 }'

问题是,工作站拥有多个ip,一个是静态的,一个是不使用Internet的本地地址,另一个是使用与笔记本电脑使用的同一网络/路由提供的Internet。我张贴URL的帖子的所有工作行都会导致获得静态ip,而不是由网络分配的更改的ip,而该IP始终是分配给eth1端口。

那么我该如何精确地计算出带有eth1 / dynamic或类似内容的选项?

在此先感谢您

我想我主要是想在Unix OS上了解它

0 个答案:

没有答案
相关问题