Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: IPtables port forwarding

  1. #11
    Join Date
    Nov 2007
    Location
    Newry, Northern Ireland
    Beans
    1,258

    Re: IPtables port forwarding

    No problem, glad it worked for you!
    Can't think of anything profound or witty.
    My Blog: http://gonzothegeek.blogspot.co.uk/

  2. #12
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: IPtables port forwarding

    Erm...you say you are using VPN for this but you are DNAT'ing eth1 rather than tap0.
    I notice eth1 does not have an IP - did you include it in the bridge?
    ASRock P67 Extreme6, Intel i5 2500K, 8GB RAM, nVidia 6600GT, 4x1TB RAID1+0

  3. #13
    Join Date
    Nov 2007
    Location
    Newry, Northern Ireland
    Beans
    1,258

    Re: IPtables port forwarding

    Quote Originally Posted by YesWeCan View Post
    Erm...you say you are using VPN for this but you are DNAT'ing eth1 rather than tap0.
    I notice eth1 does not have an IP - did you include it in the bridge?
    The eth1 IP was obfuscated as it was his public IP. The issue appeared to be a return forwarding issue from his br0 adapter to his eth1 (public) interface.

    eth0 and tap0 are the bridged connections, so don't have IPs of their own but rather are bridged, and the br0 interface has the IP, which both constituent adaptors can listen and reply on.
    Can't think of anything profound or witty.
    My Blog: http://gonzothegeek.blogspot.co.uk/

  4. #14
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: IPtables port forwarding

    Good thing you understand it
    ASRock P67 Extreme6, Intel i5 2500K, 8GB RAM, nVidia 6600GT, 4x1TB RAID1+0

  5. #15
    Join Date
    Oct 2007
    Location
    Portugal
    Beans
    277

    Re: IPtables port forwarding

    Quote Originally Posted by spynappels View Post
    The eth1 IP was obfuscated as it was his public IP. The issue appeared to be a return forwarding issue from his br0 adapter to his eth1 (public) interface.

    eth0 and tap0 are the bridged connections, so don't have IPs of their own but rather are bridged, and the br0 interface has the IP, which both constituent adaptors can listen and reply on.
    Exactly.
    Also I have just tested with battle.net and it's working 100%.
    Thank you once again.

  6. #16
    Join Date
    Nov 2007
    Location
    Newry, Northern Ireland
    Beans
    1,258

    Re: IPtables port forwarding

    No problem, thanks for the +1 for membership.
    Can't think of anything profound or witty.
    My Blog: http://gonzothegeek.blogspot.co.uk/

  7. #17
    Join Date
    Oct 2007
    Location
    Portugal
    Beans
    277

    Re: IPtables port forwarding

    Sorry to resurrect such an old post, but at a user's request, I am posting the final configuration file for my server:
    Code:
    # Generated by iptables-save v1.4.4 on Thu Nov 11 22:39:57 2010
    *filter
    :INPUT ACCEPT [1249:77284]
    :FORWARD ACCEPT [781:46215]
    :OUTPUT ACCEPT [1054535:59194653]
    -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT 
    -A INPUT -i eth0 -j ACCEPT 
    -A INPUT -i eth1 -p tcp -m tcp --dport 1194 -j ACCEPT
    -A INPUT -i eth1 -p tcp -m tcp --dport 6112 -j ACCEPT
    -A INPUT -i eth1 -p udp -m udp --dport 6112 -j ACCEPT
    -A INPUT -i eth1 -j DROP 
    -A INPUT -i tap0 -j ACCEPT 
    -A INPUT -i br0 -j ACCEPT
    -A FORWARD -i eth1 -p tcp --dport 6112 -j ACCEPT
    -A FORWARD -i eth1 -p udp --dport 6112 -j ACCEPT
    -A FORWARD -s 192.168.2.0/24 -i eth1 -o br0 -m conntrack --ctstate NEW -j ACCEPT 
    -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT 
    -A FORWARD -i br0 -j ACCEPT 
    -A FORWARD -i br0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT 
    COMMIT
    # Completed on Thu Nov 11 22:39:57 2010
    # Generated by iptables-save v1.4.4 on Thu Nov 11 22:39:57 2010
    *nat
    :PREROUTING ACCEPT [3627:1141810]
    :POSTROUTING ACCEPT [0:0]
    :OUTPUT ACCEPT [1044:69692]
    -A PREROUTING -i eth1 -p tcp --dport 6112 -j DNAT --to-destination 192.168.2.5:6112
    -A PREROUTING -i eth1 -p udp --dport 6112 -j DNAT --to-destination 192.168.2.5:6112
    -A POSTROUTING -j MASQUERADE
    COMMIT
    # Completed on Thu Nov 11 22:39:57 2010

Page 2 of 2 FirstFirst 12

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
  •