Results 1 to 2 of 2

Thread: Redirecting selected ports to virtual machines

  1. #1
    Join Date
    May 2012
    Beans
    4

    Redirecting selected ports to virtual machines

    I am using Ubuntu 12.04 and have set up and qemu/kvm guest acording to this very good tutorial: https://help.ubuntu.com/community/KVM/

    The client is installed (debian) and is working well. I can access the internet out of my guest and would now like to set up an web server.
    For now I only have one IP adresse over my wlan device. Later I want to move the guest to another host which has several IPs and build a bridge.

    So for now I have set up a "Usermode Networking" according to this: https://help.ubuntu.com/community/KVM/Networking (default mode).

    Now I want to reach my guest webserver out of the internet/my lan. My host IP is 192.168.0.150 and my guest IP is 192.168.122.178.

    If I open the web browser on my host I can reach the apache of the guest by entering "192.168.0.150".

    So I thought I just have to set the Iptables rule for redirecting the port 80 and I can reach it! But it doesnt work

    Code:
    iptables -t nat -A PREROUTING -d 192.168.0.150 -p tcp --dport 80 -j DNAT --to-destination 192.168.122.178:80
    Have I done anything wrong?

  2. #2
    Join Date
    May 2012
    Beans
    4

    Re: Redirecting selected ports to virtual machines

    Does nobody have an answer for me? My ifconfig shows the bridging-device, but I am not sure if bridging and routing is mixable?
    http://nopaste.info/fe53e46ac7.html

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •