If you want a web server, ssh, ftp or any other service, you usually need a static IP. So, you have two options:- To pay for a static IP with your ISP
- To use a dynamic DNS. Yes, dynamic DNS.
1. Create an account in DynDNS
There are several providers that offer Dynamic DNS. One of best known is DynDNS. This site offers a free DNS until 2 hosts. You have to register and create a new host. This host is a name (under dyndns domain - *.dyndns-blog.com) which you have to connect. Other option is to create a new domain.
2. To install a virtual machine with Ubuntu
I have installed an Ubuntu server in a virtual machine. This is going to be my ssh server. So, you have to install at least openssh such as additional packages in the installation of ubuntu server.
Then you have to set up a static IP inside of your private network. For example, you can set up the IP 192.168.1.200. So you have to edit /etc/network/interface file and add the static IP.
| # The primary network interface auto eth0 iface eth0 inet static address 192.168.1.200 netmask 255.255.255.0 gateway 192.168.1.1 |
To ensure that virtual machine is well installed and configured, you can reboot the virtual machine and try to connect from the phishical computer or other virtual machine.
3. Configure ddclient
Ddclient is a Perl client used to update dynamic DNS entries for accounts
on Dynamic DNS Network Services' free DNS service. The configuration is very simple.
| $ sudo apt-get install ddclient |
During the installation, the installer will ask us for username, password and the Dynamic DNS service provider. In linhost there is a complete tutorial to configure it. http://linhost.info/2008/12/ddclient-set-up-for-ubuntu/
Other posibility is to configure in the router instead of ddclient on server. Nowadays, routers have this service by default. You only need is to enable it.
4. Router
And finally, we have to activate the ssh port in the router and redirect the 22 port to virtual machine. This was a headache, because my router is special (Telefónica).
In resume we need to activate ssh service from WAN. In this point you can activate for example, Web Server (port 80) or any other.
Then you need to redirect the ports to virtual machine. In my case, I had to add an additional entry to NAT with port 22 to 192.168.1.200.
References
- DynDNS: http://dyn.com/dns/dyndns-free/
- Ubuntu help: https://help.ubuntu.com/community/DynamicDNS

0 comentarios:
Publicar un comentario en la entrada