Can you provide some more detail about how you have your network setup and exactly what you want to achieve by enabling port forwarding (is there a particular application you need to get working for example)?
If im not mistaken I use Ip Tables to do this?
I've researched a little and I just wanted to find out some answers:
iptables –t nat –A PREROUTING –p udp 50* –j DNAT –-to 192.168.1.106
iptables –P FORWARD ACCEPT
iptables –-table nat –-append POSTROUTING –-out-interface eth0 –j MASQUERADE
In order to make the forwarding work, can I just run these commands? Can I specify the port by just adding the number *'d above? Do I need to ARP the router? Set up MiTM between me and router?
I saw a simliar thread with these commands but it was quite old and I didnt want to revive an old thread. Also it didnt quite answer those questions.
Thank you in advance
Can you provide some more detail about how you have your network setup and exactly what you want to achieve by enabling port forwarding (is there a particular application you need to get working for example)?
Capitalisation is important. It's the difference between "Helping your brother Jack off a horse" and "Helping your brother jack off a horse".
The Forum Rules, Forum FAQ and the BackTrack Wiki... learn them, love them, live them.
There's two ways of setting up port forwarding on a router:
1) You connect to the router via telnet or HTTP, give it the username and password, then proceed to change the settings.
2) Use the UPnP protocol if it's supported by your router. With the UPnP protocol, you can send requests to your router to do stuff like open NAT pinholes.
Here's some info on UPnP:
CodeProject: Using UPnP for Programmatic Port Forwardings and NAT Traversal. Free source code and programming help
Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".
Thank you for that i was completely unaware of this.
I know its the wrong place and i had really no reason to seek out a place to ask, or research it myself .. but since this is here why not.
Besides uPnP, would the iptables method work on my openwrt router ? .. aswell as my ddwrt?
Using backtrack for the first time is like being 10 years old again with the keys to a Ferrari.
Wait a minute... which situation are you in?
Situation 1: You're using a Linux computer that's connected to a LAN which has a router. You want to use the Linux machine to enable port forwarding on the router.
Situation 2: You're playing around with programming a router (e.g. OpenWRT).
These are two very different situations. The solution I offered was for Situation 1.
As for Situation 2: Well if you're running Linux on a router, then I suppose using IPTables would be the way to go about it... but I've never done it before so I can't give any advice.
Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".
It is situation 1, but i do have openwrt on my router as the firmware. If i can do it with iptables that would be great as it saves me having to ssh wrap the http connectionwhen im away.
Using backtrack for the first time is like being 10 years old again with the keys to a Ferrari.
From what I'm reading the op is trying to bypass the current network's router to get mail forwarding using iptables on his laptop.
Of course, if you really wanted to have some fun, go to Wal-Mart late at night and ask the greeter if they could help you find trashbags, roll of carpet, rope, quicklime, clorox and a shovel. See if they give you any strange looks. --Streaker69
Situation #1.
Trying to set port forwarding on the router without generic 192.168.1.1 -> login/pass route.
I was not able to telnet into my router.
I'll look more into UPnP.
Is there any other alternatives? Are those the only methods of setting port forward for a router?
Of course, if you really wanted to have some fun, go to Wal-Mart late at night and ask the greeter if they could help you find trashbags, roll of carpet, rope, quicklime, clorox and a shovel. See if they give you any strange looks. --Streaker69
I had assumed that this was a exercise, either for fun or to learn something.
Are you saying you're really trying to enable port-forwarding on your router? Type the router's IP address into a webbrowser and go from there.
Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".