1830250 Members
2685 Online
110000 Solutions
New Discussion

Natting on Linux box

 
varian_1
Advisor

Natting on Linux box

Hi,

Requirement :
url on the IP address 192.168.152.113 should be able to access using 172.26.12.112 IP address by the users from 192.168.31.x series network.

Plan : Setup of Linux server which will Nat IP address of 192.168.152.113 to 172.26.12.112

Can some body tell me what is the basic requirement for the same.

Regards

Walter Crasto
3 REPLIES 3
Bill Thorsteinson
Honored Contributor

Re: Natting on Linux box

I would install shorewall and setup
a DNAT rule for this.

If you want to build your own rules check
the documentation at the Linux Documentation
Project http://tldp.org. There is a
document on configuring NAT.
Alexander Chuzhoy
Honored Contributor

Re: Natting on Linux box

you can use iptables for this:


first:
echo 1 > /proc/sys/net/ipv4/ip_forward

then:
iptables -t nat -A PREROUTING -s 192.168.31.0/24 -j DNAT --to-destination 192.168.152.113

and:
iptables -t nat -A POSTROUTING -j MASQUERADE

that's it
Thomas Bianco
Honored Contributor

Re: Natting on Linux box

consider using a specialized firewall distribution, like monowall or smoothwall. these are prepackaged with everything needed, are simple to configure and maintain, and include firewalling featrues should you need them.
There have been Innumerable people who have helped me. Of course, I've managed to piss most of them off.