Securityhome.eu

Forum of securityhome.eu
It is currently Sun Sep 05, 2010 9:25 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: forward ports in iptables
PostPosted: Wed Jul 07, 2010 8:56 pm 
Offline

Joined: Sat Jun 20, 2009 5:42 pm
Posts: 16
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


Top
 Profile  
 
 Post subject: Re: forward ports in iptables
PostPosted: Wed Jul 07, 2010 9:36 pm 
Offline
Site Admin

Joined: Mon Jul 21, 2008 9:45 am
Posts: 26
Location: Leuven, Belgium
You can easily create a forward port with the following command:
Code:
iptables -t nat -A PREROUTING -p tcp --dport 8080 -i eth0 -j DNAT --to 192.168.1.1:80


The following command list all the forward rules the
Code:
iptables -t nat -L PREROUTING -n --line-numbers


This command delete the second rule:
Code:
iptables -D PREROUTING 2 -t nat


This should do what you ask.
It is easy and quick.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl