Results 1 to 5 of 5
ok, the situation.
i have the following scenario:
-----------
|internet |
-----------
|
|
|
------------
|Cablemodem|
------------
|
|
|
|Blueyonder DHCP Assigned{eth1:}
------------
| gateway |
------------
|192.168.0.1{eth0}
...
- 04-26-2005 #1
iptables port forwarding
ok, the situation.
i have the following scenario:
now, i have setup an application called palantir that allows me to stream my webcam to the internet, and it uses port 3000, now what i need to do is forward requests on eth1, port 3000 of the gateway to my computer, how do i set this up using iptables?-----------
|internet |
-----------
|
|
|
------------
|Cablemodem|
------------
|
|
|
|Blueyonder DHCP Assigned{eth1:}
------------
| gateway |
------------
|192.168.0.1{eth0}
|
|
------------
| switch |
------------
| | |
| | |
| | |192.168.0.9{eth0:}
X X --------------
| workstation|
--------------
|
|
|USB webcam {/dev/video0}
Hope the diagram helps in what i need to do.
"I am not an alcoholic, alcoholics go to meetings"
Registered Linux user = #372327
- 04-26-2005 #2Linux Enthusiast
- Join Date
- Feb 2005
- Location
- SE, Stockholm
- Posts
- 512
It should be something like this
Code:iptables -A PREROUTING -i eth1 -p tcp -m tcp --dport 3000 -j DNAT --to-destination 192.168.1.9:3000 iptables -A INPUT -i eth1 -p tcp -m tcp --dport 3000 -j ACCEPT
- 04-26-2005 #3ok, the first line gives an error:
Originally Posted by swemic
jebediah:~ # iptables -A PREROUTING -i eth1 -p tcp -m tcp --dport 3000 -j DNAT --to-destination 192.168.0.9:3000
iptables: No chain/target/match by that name"I am not an alcoholic, alcoholics go to meetings"
Registered Linux user = #372327
- 04-27-2005 #4Just Joined!
- Join Date
- Apr 2005
- Posts
- 1
iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 3000 -j DNAT --to-destination 192.168.1.9:3000
iptables -A INPUT -i eth1 -p tcp -m tcp --dport 3000 -j ACCEPT
add -t nat
- 04-27-2005 #5Linux Enthusiast
- Join Date
- Feb 2005
- Location
- SE, Stockholm
- Posts
- 512
Yeah, I forgot that "-t nat" *sorry about that*


Reply With Quote