LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Ip Forwarding Question (https://www.linuxquestions.org/questions/linux-security-4/ip-forwarding-question-27221/)

NUX 08-05-2002 04:00 AM

Ip Forwarding Question
 
I need a little help with forwarding

Setup : Machine 1
Suse Linux 7.1 / Kernel 2.4.16-35
Iptables 1.2.6a
1 dynamic ip address
Apache 1.26

Machine 2
W95

I have client windows applications (running in var. countries)
which connect on port 2300 on the linux machine
I need to forward this port to the windows machine ,
where I have a server running ,which triggers a sql query
when a client connects and then sends back a result set to the connected client application.

How to correctly call iptables ?
something like :
iptables -t nat -A postrouting -o eth0 -j SNAT ........

Thanks for any help

webtoe 08-05-2002 05:06 AM

iptables -A PREROUTING -p tcp --dport 2300 -i eth0 -j DNAT --to ipofwindows:porttoaccess

iptables -A POSTROUTING -o eth0 -j MASQUERADE

That might do it. Not sure if that will work so........Im not expert at iptables. I read this from a magazine.

you could always try a GUI app to set it up.

Alex

btw, you will need the relevant bits in the kernel for the nat stuff unless you didn't know.

NUX 08-05-2002 09:04 PM

Tried but it did not work .....

webtoe 08-06-2002 05:13 AM

I have a feeling that the last rule may be wrong. It will need to be -o eth1 (your card going to the windows machine) and it may need an -i eth0 for the card connected to the net. so it will be
iptables -A POSTROUTING -i eth0 -o eth1 -j MASQUERADE

You'll have to look at the man page or on www.google.com/linux since my skills at iptables are shabby at best. The main structure should be there though.

Alex

p.s.Sorry I was no good but sometimes you need to admit ignorance before you can become informed. If you find a solution post it back so we know how to do it in future.

peter_robb 08-12-2002 01:26 PM

should be iptables -t nat -A ~~~

Regards,
Peter


All times are GMT -5. The time now is 03:54 PM.