09 May 2009

NAT on Fedora 9

I want to access my computer with Private IP (192.168.1.3) from Internet. To do this, I need a computer can act as NAT (Network Address Translator). This computer was called as proxy server. Proxy server use Public IP = 202.46.3.71. To access Private IP from Internet, I use combination between Public IP and Port. For instance, we use port 9002. To activate NAT, I must run these command lines below on Proxy Server as root user.


Example:

# iptables -I FORWARD -i eth0 -o eth1 -p tcp --dport 9002 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
# iptables -I PREROUTING -t nat -p tcp -d 202.46.3.71 --dport 9000 -m state --state NEW,ESTABLISHED,RELATED -j DNAT --to 192.168.1.3:80

To access my computer with Provate IP from Internet, I just use address : http://202.46.3.71:9000/

No comments:

Post a Comment