help needed.
We have one linux as gateway with multiple static ips (212.23.233.2-60) and nat .We also have lan with ip range 192.168.132.0/24.
This works ok, every machine on lan connecting to internet shows up with ip 212.23.233.2 (which is our linux), but i'd like to set one of the lan machines to use static ip ex. 192.168.132.230 so that it shows with 212.23.233.40 example and connections from outside to ip 212.23.233.40 will be natted on 192.168.132.230. Our linux configuration eth0 212.23.233.2, eth0:0 212.23.233.3, eth0:1 212.23.233.4 and so on... eth1 is unused, eth2 192.168.132.1 Default gw 212.23.233.1.
Thanks in advance.
Quoted 7 lines · Mikko Kallio
We have one linux as gateway with multiple static ips (212.23.233.2-60) and nat .We also have lan with ip range 192.168.132.0/24. This works ok, every machine on lan connecting to internet shows up with ip 212.23.233.2 (which is our linux), but i'd like to set one of the lan machines to use static ip ex. 192.168.132.230 so that it shows with 212.23.233.40 example and connections from outside to ip 212.23.233.40 will be natted on 192.168.132.230.
iptables -A POSTROUTING -t nat -s 192.168.132.230 -j SNAT --to 212.23.233.40 iptables -A PREROUTING -t nat -d 212.23.233.40 -j DNAT --to 192.168.132.230
Plus whatever FORWARDing rules you need to allow through the protocols you want.
Antony.
Signature · 4 lines
If builders built buildings the way programmers write programs,
then the first woodpecker that came along would destroy civilisation.
Please reply to the list;
please don't CC me.Quoted 3 lines
iptables -A POSTROUTING -t nat -s 192.168.132.230 -j SNAT --to 212.23.233.40 iptables -A PREROUTING -t nat -d 212.23.233.40 -j DNAT --to 192.168.132.230
And you have to make the linux box respond to arp requests on the outside interface:
ip addr add dev ethX 212.23.223.40
//Jesper
Quoted 8 lines · Jesper Lund
Quoted 3 lines
iptables -A POSTROUTING -t nat -s 192.168.132.230 -j SNAT --to 212.23.233.40 iptables -A PREROUTING -t nat -d 212.23.233.40 -j DNAT --to 192.168.132.230
And you have to make the linux box respond to arp requests on the outside interface:
ip addr add dev ethX 212.23.223.40
I'm pretty sure from Mikko's original posting that this is already dealt with.
Antony.
Signature · 6 lines
"John Major" and "Cher" are as much abstractions as "the national debt" or
"the state of Welsh rugby".
- Guy Claxton, Hare Brain, Tortoise Mind
Please reply to the list;
please don't CC me.