Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

iptables port forwarding

  • 17-05-2010 11:01am
    #1
    Closed Accounts Posts: 17,208 ✭✭✭✭


    Hey guys,

    I am having some problems forwarding ports on my Ubuntu 9.10 server to a VirtualBox VM running in the same machine. I am looking to forward any traffic on port 8080 to the VM (to start, others may be ported later).

    I have tried using rules I found in this article, but they don't seem to be having the desired effect.

    iptables -t nat -A PREROUTING -p tcp -i eth0 -d xxx.xxx.xxx.xxx --dport 8080 -j DNAT --to 192.168.122.1:80
    iptables -A FORWARD -p tcp -i eth0 -d 192.168.122.1 --dport 80 -j ACCEPT

    Any traffic going to machine:8080 is going to the local server, not the VM hosted one.

    This is my first time having to look to iptables, so any assistance would be greatly appreciated.


Comments

  • Registered Users, Registered Users 2 Posts: 16,288 ✭✭✭✭ntlbell


    It's been awhile since I did this, but IIRC you shouldn't need to use iptables at all

    VBoxManage should be able to manage for it for you


  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    VBoxManage will take care of data coming into the computer and redirect it to the VM? I didn't know that, will look down that route.


  • Registered Users, Registered Users 2 Posts: 16,288 ✭✭✭✭ntlbell


    VBoxManage will take care of data coming into the computer and redirect it to the VM? I didn't know that, will look down that route.

    It will take care of the traffic from host to guest.

    so you might need something like

    allow 8080 on the host.

    VBoxManage should manage the "forward" or "re-direct" from host to guest

    if that makes sense?


  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    Thats exactly what I need. Cool, time to bone up on the VBoxManage documentation :)


Advertisement