7 thoughts on - Redirecting Web Requests From Localhost

  • Could be hardcoded in your java app, by hostname or ip?

    Just open your java (its a zip renamed) and see file contents (some of files inside, are text plain).

    Also, you can find a debuger

    Diego Sanchez

    Sent from my mobile

    —–Original Message—

  • IF (IF) is trying to get data by hostname, dnsmasq maybe could help. IF (IF) is by ip addres, problem still here.

    First he need understand how is working the app or wait to developer.

    I prefer lost 2 minutes with grep, that a lot of minutes with dnsmasq AND 2 minutes with grep later..

    Diego Sanchez

    Sent from my mobile

    —–Original Message—

  • I think you has to do POSTROUTING
    anyway, check the port, it is wrong at least in your post – 80 vs. 443


    dummy interface, in ifcfg-dummy, something similar to this:


  • hmm, locally generated messages do not pass the PREROUTING AFAIK
    this was why I was suggesting POSTROUTING, but… POSTROUTING is wrong too according to the manpage for iptables

    This target is only valid in the nat table, in the PREROUTING and OUTPUT chains, and user-defined chains which are only called from those chains.

    If I read it correct, this rule should go into the OUTPUT chain.

  • You have the prerouting but you have to forward it as well. This allows a connection on the Internet to make a connection to a internal machine on my local network. Router machine’s local network ip on eth1. internal machine. iptables -A FORWARD -p tcp -i ppp0 -o eth1 -d –dport 1234 -j ACCEPT
    iptables -t nat -A PREROUTING -p tcp -i ppp0 –dport 1234 -j DNAT

    ip and ports changed to protect the guilty :)