PDA

View Full Version : Editing entries in iptables



LaB
17-06-2004, 17:31
here we go again... ;)

Is it possible to edit directly in iptables?! I see the output using iptables -L -t nat -v, but I want to be able to add a line...

the reason: I want to make all traffic to a specific port on the WAN side go to a different port on the LAN side...


thanks for any help...

LaB

Oleg
17-06-2004, 17:42
Virtual Server? If so everything is already there as seems? Or you need something special? If so, you need to use custom firmware and write the /usr/local/init/post-firewall script.

LaB
17-06-2004, 18:03
yes, virtual server. Have 3 machines that I would like to remote administer. Therefore I have assigned them each an external port, which all need to be forwarded to the internal IP on port 3389.

unfortunately, /usr/local/ is completely empty...

Oleg
17-06-2004, 20:03
You need to manually create /usr/local/init directory and post-firewall file. After that you will need to make it executable using


chmod +x /usr/local/init/post-firewall

and save your your changes to flashfs

LaB
17-06-2004, 21:58
how do I go about saving the changes?

commit flashfs

?
and what would the string inside the file read? would it be

iptables -F
iptables -A CUSTOMINPUT -i br0 -p tcp -source-port 7533 -dest 192.168.1.0:3368

?