Results 1 to 10 of 10
Well I am pretty new to NAT/Portforwading/Netmasks
And I have no idea what I do wrong now.
I want to Forward port 5911 to port 5901
So I use IPTables:
...
- 11-23-2007 #1
Portforwarding (Newb)
Well I am pretty new to NAT/Portforwading/Netmasks
And I have no idea what I do wrong now.
I want to Forward port 5911 to port 5901
So I use IPTables:
And Ill get DNAT target: bad hook_mask 16. So I thought, lets check that out..Code:iptables -t nat -A POSTROUTING -p tcp -d 192.168.42.112 --dport 5911 -j DNAT --to 192.168.1.11:5901
So I googled for "DNAT taarget: bad hook_mask 16"
Bad luck.
SO I checked again on the internet and I just cant put my finger on this.
HOW can I tunnel one port to another using iptables.
I can do It with netcat. but thats pretty unrelayable. (Unstable)
Cheers,
Robin
Edit:
Ok It resolved now (the command):
$IPTABLES -t nat -I PREROUTING -p tcp -i $EXTIF --dport 6346 -j DNAT --to 192.168.0.2:6346 (Example)
but, It doesnt work.
When I point my browser to the iptables box it doesnt work
When I do iptables -L -t nat Ill get
Code:Chain PREROUTING (policy ACCEPT) target prot opt source destination DNAT tcp -- anywhere 192.168.42.112 tcp dpt:www to:192.168.1.10:80
- 11-26-2007 #2
Ok, well if I do: iptables -L -t nat now Ill get:
But still Port 80 isnt beeing send right..Code:target prot opt source destination DNAT tcp -- anywhere 192.168.42.112 tcp dpt:www to:192.168.1.10:80 DNAT tcp -- anywhere anywhere tcp dpt:www to:192.168.1.10:80 DNAT tcp -- anywhere anywhere tcp dpt:www to:192.168.1.10:80
Since I still cant call the Website on that PC.
- 11-26-2007 #3
This would be the correct way of doing that
Another question I have is if this connection is stopping at the firewall box?Code:ptables -t nat -A PREROUTING -p tcp -d 192.168 42.112 --dport 5911 -j DNAT --to-destination 192.168.42.122:5901
If it is 'yes' then you need to REDIRECT it and not DNAT and tyhat would look like this:
Code:iptables -t nat -A PREROUTING -p tcp --dport 5911 -j REDIRECT --to-ports 5901
Here is a GREAT! Iptables Tutorial
http://iptables.rlworkman.net/chunkyhtml/index.html
- 11-26-2007 #4
- 11-27-2007 #5
What don't you get? The difference between REDIRECT and DNAT? Or something else?
- 11-28-2007 #6
- 11-28-2007 #7
can you post the complete file not the -L output. I read files a lot easier then I do that outputs from -L.
Maybe then I can see where your problem is.
- 11-29-2007 #8
- 11-29-2007 #9Just Joined!
- Join Date
- Aug 2007
- Posts
- 2
can u help me to connect myself in internet using my fc6
- 11-29-2007 #10


Reply With Quote

