Page 3 of 3 FirstFirst 123
Results 21 to 26 of 26

Thread: iptables redirect

  1. #21
    Join Date
    Sep 2010
    Beans
    120

    Re: iptables redirect

    should i use ppp0 or dsl-provider or are they the same thing?

  2. #22
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: iptables redirect

    You should use whatever interface name is listed in output of ifconfig command.

    I suggest using traceroute to see what route your packets take from your request via ppp0 to the server. Also, I never heard back if the requests show up in the server log when from ppp0. This is kind of important as it narrows down if the forward or reverse route is the problem.

    I'm afraid there are just so many factors at play here that I don't have access to. eg. what is the routing on the web server? If it is routing to the wrong place then return packets won't come back to your redirect machine and get lost.
    Last edited by BkkBonanza; March 22nd, 2011 at 01:05 PM.

  3. #23
    Join Date
    Sep 2010
    Beans
    120

    Re: iptables redirect

    ok what I just figured out is this, if I default apache2 to use /var/www it works page pops up & the forwarding works but if i set it up to use the moodle website it stops working....

  4. #24
    Join Date
    Sep 2010
    Beans
    120

    Re: iptables redirect

    I abandoned this and just put my web server directly onto the net...thanks for trying though but linux seems to be a mission to get port forwarding working.

  5. #25
    Join Date
    Sep 2010
    Beans
    120

    Exclamation Re: iptables redirect

    After a lot more Google searches I managed to find a the solution to my problem, Just thought i would share this with you...

    Got the settings from http://ubuntu.serversignature.com/?m=201006

    iptables -A INPUT -m state --state NEW -i ppp0 -j ACCEPT
    iptables -A FORWARD -i ppp0 -p tcp --dport 80 -j ACCEPT
    iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 192.168.2.150:80
    iptables -A FORWARD -i eth0 -o ppp0 -j ACCEPT
    iptables -A FORWARD -i eth0 -o ppp0 -m state --state ESTABLISHED,RELATED -j ACCEPT
    iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
    iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
    echo 1 > /proc/sys/net/ipv4/ip_forward
    echo 1 >/proc/sys/net/ipv4/tcp_syncookies
    echo 1 >/proc/sys/net/ipv4/conf/all/rp_filter

    Thanks again for all the help
    Last edited by viperce; April 1st, 2011 at 10:22 AM.

  6. #26
    Join Date
    Sep 2010
    Beans
    120

    [Solved]Re: iptables redirect

    how do i mark this as [Solved] now??
    Last edited by viperce; April 1st, 2011 at 10:21 AM.

Page 3 of 3 FirstFirst 123

Tags for this Thread

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
  •