Welcome to my site. Please CLICK HERE to give your opinions regarding this new look of "PCTipsbyAnu". Thanks for visiting.

Sunday, September 12, 2010

Browse » Home » , , , , » LINUX : How to forward a port?

LINUX : How to forward a port?

Port forwarding allows remote computers, for example, computers on the Internet, to connect to a specific computer or service within a private local area network (LAN).
In Linux kernels, this is achieved by packet filter rules in the iptables or netfilter kernel components. BSD and Mac OS X operating systems implement it in the Ipfirewall (ipfw) module.
This is also useful (a little bit useful) for hiding your port from hackers.
So, lets check it ....

IP Forwarding
echo "1" > /proc/sys/net/ipv4/ip_forward

Policy

/sbin/iptables -P INPUT ACCEPT
/sbin/iptables -P OUTPUT ACCEPT
/sbin/iptables -P FORWARD ACCEPT

IP Masquerade
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Forward
/sbin/iptables -A FORWARD -i eth0 -j ACCEPT

Portforwarding from 192.168.10.1:8888 to 192.168.13.5:80

/sbin/iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 8888 -j DNAT --to 10.144.65.230:80
/sbin/iptables -A FORWARD -p tcp -i eth0 -d 10.144.65.230 --dport 80 -j ACCEPT

Leave a comment for more information on that topic.....

After a short practice, i'll post a Tutorial "How to use TCPDUMP in linux?"...

May be tomorrow.......

Have a fun
You can leave a response, or trackback from your own site.

About 'Anu': My name is 'Anu' also Known as 'ANU 007 TIGER' .I'm administrator of 'PC Tips by Anu' blog .This blog was opened for sharing contents about hacking n cracking.
Thanks YAHOO OR GMAIL

0 comments:

Post a Comment

 
Back to Top