Raised on a virtual machine with Ubuntu FTP-server. She (virtual machine) gets a dynamic ip-address from a DHCP server running on a router.

How to make it so that every time you connect to this FTP server, you do not need to check what is his current ip?

In networks is not strong, I write right away.

  • Would you explain in more detail what you need? - aleks.andr
  • I need to connect to the virtual machine via ftp from the main axis, the ubuntu virtual server is set up, the ftp server has been configured on it, only the ip on it changes and every time I watch what ip and prescribe it when connecting is not very convenient, can I make it static? ? - quaresma89
  • one
    You need to either configure your dhcp server so that it always displays the same ip as Ubuntu, or assign it a static ip in the interface settings. - aleks.andr
  • Thanks now I will look for how to do it! - quaresma89
  • I read about what you advised me, did not quite understand where to set it all up, on the router? Or in the Wirth machine settings. I understand that if you disable DHCP on the router, all devices that will be connected to the router will have the same ip? - quaresma89

1 answer 1

You need to ensure that your FTP server always has the same ip address on the network.

This issue can be resolved in several ways:

1) Use a static ip-address in the interface settings:

# В /etc/network/interfaces прописать: iface eth0 inet static address 192.168.0.1 netmask 255.255.255.0 gateway 192.168.0.254 dns-nameservers 192.168.0.254 8.8.8.8 auto eth0 

More on the link .

2) Configure the dhcp server in such a way as to assign a specific ip to a specific MAC address.

How to do this depends on where and how your dhcp server is running. For example, my Zyxel router allows you to perform a similar setup through your own web interface like this:

dhcp zyxel setup

3) There are certainly other ways, but they are unknown to me. Maybe more knowledgeable gurus will help.

  • one
    You can also try to use Avahi, and contact the VM by name. Moreover, in Ubuntu, it seems like Avahi is already installed by default. - spopovru
  • Need to try! - quaresma89