HowTo redirect a tcp connection to 10.1.1.5:1234 (IP my eth1(loc) interface) to localhost:4321 (generated from ssh forward)? something like this? DNAT loc fw:127.0.0.1:4321 tcp 1234 - 10.1.1.5 or REDIRECT (?) Many Thanks!! ------- Dario Lesca (d.lesca@ivrea.osra.it)
On Thu, 27 Mar 2003, Dario Lesca wrote:> HowTo redirect a tcp connection to 10.1.1.5:1234 (IP my eth1(loc) interface) > to localhost:4321 (generated from ssh forward)? > > something like this? > DNAT loc fw:127.0.0.1:4321 tcp 1234 - 10.1.1.5 > or > REDIRECT (?) >REDIRECT loc 4321 tcp 1234 -Tom -- Tom Eastep \ Shorewall - iptables made easy Shoreline, \ http://www.shorewall.net Washington USA \ teastep@shorewall.net
----- Original Message ----- From: "Tom Eastep" <teastep@shorewall.net>> > > HowTo redirect a tcp connection to 10.1.1.5:1234 (IP my eth1(loc)interface)> > to localhost:4321 (generated from ssh forward)? > > > > something like this? > > DNAT loc fw:127.0.0.1:4321 tcp 1234 - 10.1.1.5 > > or > > REDIRECT (?) > > > > REDIRECT loc 4321 tcp 1234 > > -TomNot work, this rule redirect loc traffic for 10.1.1.5:1234 to 10.1.1.5:4321 [root@giove root]# iptables-save |grep 1234 -A loc -p tcp -m tcp --dport 1234 -j REDIRECT --to-ports 4321 I want redirect traffic for 10.1.1.5:1234 to 127.0.0.1:4321 this is the netstat -nat output: [lesca@giove lesca]$ netstat -nat|grep 1234 tcp 0 0 127.0.0.1:1234 0.0.0.0:* LISTEN the service 1234 is not bind to all IP (then also 10.1.1.5) like, for example, ssh: [lesca@giove lesca]$ netstat -nat|grep 22 tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN ... some suggest? many thanks ------- Dario Lesca (d.lesca@ivrea.osra.it)
On Fri, 28 Mar 2003, Dario Lesca wrote:> ----- Original Message ----- > From: "Tom Eastep" <teastep@shorewall.net> > > > > > HowTo redirect a tcp connection to 10.1.1.5:1234 (IP my eth1(loc) > interface) > > > to localhost:4321 (generated from ssh forward)? > > > > > > something like this? > > > DNAT loc fw:127.0.0.1:4321 tcp 1234 - 10.1.1.5 > > > or > > > REDIRECT (?) > > > > > > > REDIRECT loc 4321 tcp 1234 > > > > -Tom > > Not work, this rule redirect loc traffic for 10.1.1.5:1234 to 10.1.1.5:4321 > > [root@giove root]# iptables-save |grep 1234 > -A loc -p tcp -m tcp --dport 1234 -j REDIRECT --to-ports 4321 > > > > I want redirect traffic for 10.1.1.5:1234 to 127.0.0.1:4321 >Then use your original rule... -Tom -- Tom Eastep \ Shorewall - iptables made easy Shoreline, \ http://www.shorewall.net Washington USA \ teastep@shorewall.net