iptables port alias

Posted on 2006-06-01
Last Modified: 2010-07-27
i'd like to have all connections to port 5000 handled by server at port 80

how does one do that ?
(i tried following, but didn't work - i really don't have a clue about iptables :blush
/sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 5000 -j DNAT --to
/sbin/iptables -A FORWARD -i eth0 -p tcp --dport 80 -j ACCEPT
Question by:ed987
    1 Comment
    LVL 28

    Accepted Solution

    you don't need the second line. the first one looks correct
    1) make sure that there aren't any chains before the DNAT that interfere with this one
    2) make sure that eth0 is indeed the interface getting the packats (check that the ip you are connecting is indeed the one from eth0)
    3) make sure that the webserver is indeed lic\stening on (either explicitly or it's listening on use netstat -an)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
    Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now