Thibor 12 and port forwading

Discussion in 'HyperWRT Firmware' started by darekd, Jan 18, 2006.

  1. darekd

    darekd Network Guru Member

    I just installed Thibor 12 and I cannot find port forwarding setting. I want to forward certain port (not port range) to another port for specified IP. Can I do it in this firmware? Thanks.
  2. Thibor

    Thibor Super Moderator Staff Member Member

    you have to use iptables command in the firewall script to forward to a different internal port
  3. darekd

    darekd Network Guru Member

    I know nothing about iptables. Where can I find sample syntax for what I want achieve? Will I have to re-enter it if I reboot the router?
  4. zaphod

    zaphod Network Guru Member

    just use port-range... for example

    you want to forward port 25 then use range 25 - 25...


  5. NateHoy

    NateHoy Network Guru Member

    zaphod -

    The point is to forward one external port to a different internal port. So, for example, incoming requests on port 555 would hit a specified local server on port 80, so from the outside you could hit your Internet connection on port 555 and it would NAT the request to your server on port 80.

    darekd -

    There's a discussion I found googling "iptables WRT54G forward one port to another port" that might help you get started:,14451984?hilite=wrt54g+port+forward&r=828

    Or you can go here for more sources (some will not be relevant, of course):
  6. zaphod

    zaphod Network Guru Member


    yep i know what portforwarding means.... i dont have access to my wrt here so i couldnt check if its possible in the web interface...

    but its no problem to use iptables for that...

    its just a little script which should be placed into the startup...

    so long...

    zaphod @ office
  7. darekd

    darekd Network Guru Member

    These two lines did the trick. I also put them in the firewall startup script.

    iptables -t nat -I PREROUTING -p tcp --dport 22222 -j DNAT --to

    iptables -I FORWARD -p tcp -d --dport 80 -j ACCEPT

    I have one more question. If I want to forward UDP and TCP do I need to create PREROUTING/FORWARD command separately for each of them or it can be combined in one command?

    Thanks :thumbup:
  8. Thibor

    Thibor Super Moderator Staff Member Member

    i think(but i'm not certain) that if you leave out the protocol switch (-p) that it will apply to udp&tcp
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice