Hi,
Is there an easy way to create a forward port to another machine and the delete it after a few minutes?
I don't want to leave it open.
Thanks for the help
forward ports in iptables
Re: forward ports in iptables
You can easily create a forward port with the following command:
The following command list all the forward rules the
This command delete the second rule:
This should do what you ask.
It is easy and quick.
Code: Select all
iptables -t nat -A PREROUTING -p tcp --dport 8080 -i eth0 -j DNAT --to 192.168.1.1:80
Code: Select all
iptables -t nat -L PREROUTING -n --line-numbers
Code: Select all
iptables -D PREROUTING 2 -t nat
It is easy and quick.