Routing your virtual machine network

Virtualizing your servers is pretty cool. But having a server in a hosted environment brings some restrictions with networking. To get around this, you can use a virtual network and configure some internal routing.

Enabling routing

To route our network we use IP-Forward. But as it is usually disabled, we have to first enable it.

Forwarding packets

You can either forward all packets directed a specific ip address or only the ones targeting a given port. In the following example, all packets targeting the external address 123.123.123.10 will be forwarded to the internal address 192.168.1.11.

Forward only tcp packets from the external port 80 to the internal port 8080.

Changing internal to external ip address

Now having your VMs connect to the outer world or sending responses, you probably don’t want the internal but the external address exposed. In this example, the address within the packet will be changed from the internal 192.168.1.11 to the external 123.123.123.10 when leaving the network over the interface eth0.

Blocking requests to certain ports

IP tables also offers the possibility to block certain ports. In the following example, all requests to an FTP server (port 21) on network interface eth0 will be dropped.

Saving the rules

In order to store the configured iptables settings permanently, you simply have to run the following command.

 References

49 thoughts on “Routing your virtual machine network”

  1. Pingback: graduate
  2. Pingback: akurat
  3. Pingback: Free UK Chat Rooms
  4. Pingback: best sportsbook
  5. Pingback: scorts madrid
  6. Pingback: DMPK studies
  7. Pingback: shemale.uk
  8. Pingback: lequipe.rf
  9. Pingback: buy gym equipment
  10. Pingback: Teen Chat
  11. Pingback: Madison
  12. Pingback: Share Movies
  13. Pingback: blog Lovesita
  14. Pingback: cpanel hosting
  15. Pingback: CHAT RANODM
  16. Pingback: glass merchants
  17. Pingback: free chat rooms
  18. Pingback: Rc Chemicals
  19. Pingback: millenialsi
  20. Pingback: TNT 10ML
  21. Pingback: Gvk bio inida
  22. Pingback: Fortnite skiny
  23. Pingback: uk chat rooms
  24. Pingback: GVK biosciences
  25. Pingback: GVK Biosciences
  26. Pingback: 2019

Leave a Reply

Your email address will not be published.