Skip to contentSkip to conversation

Masquerading problem - question

DISCUSSION Christos Panagiotakis 2 participants 2 messages Jan 8, 2006

lore
Share & tools
lore
#0 lore raw

Hello people. This is my first post, please be nice with me :-)

I have a little network with 3 computers. 2 workstations, 1 server. the network is 10.166.0.0
server 10.166.0.1
1 workstation 10.166.0.2 and a new one the third 10.166.0.3
server has 2 interfaces. the one is connected with another network ( 10.165.0.0) wirelessly. from the "main" server they assigned me with 2 internet static ips (for 10.166.0.1 and 10.166.0.2). But when I took the third one (10.166.0.3) I wanted to connect it with internet.
I did echo 1 > /proc/sys/net/ipv4/ip_dynaddr
and the problematic one:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
thats good! it worked! But the problem is that both 10.166.0.2
and 10.166.0.3 having internet with the server's ip address...
I just want 10.166.0.3 to share the same static ip address.
I dont know what exactly to do to make only 10.166.0.3 to "share"/masq the same ip with the server. And now I have both 10.166.0.2 and 10.166.0.3 with the same ip, yeap its working but I need the second static ip to 10.166.0.2 and I dont know what to do...

Christos Panagiotakis

ps: forgive me for my awful english I hope to understand me

#1 lore raw
Quoted 21 lines · Christos Panagiotakis

Hello people. This is my first post, please be nice with me :-)

I have a little network with 3 computers. 2 workstations, 1 server. the network is 10.166.0.0
server 10.166.0.1
1 workstation 10.166.0.2 and a new one the third 10.166.0.3
server has 2 interfaces. the one is connected with another network ( 10.165.0.0) wirelessly. from the "main" server they assigned me with 2 internet static ips (for 10.166.0.1 and 10.166.0.2). But when I took the third one (10.166.0.3) I wanted to connect it with internet.
I did echo 1 > /proc/sys/net/ipv4/ip_dynaddr
and the problematic one:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
thats good! it worked! But the problem is that both 10.166.0.2
and 10.166.0.3 having internet with the server's ip address...
I just want 10.166.0.3 to share the same static ip address.
I dont know what exactly to do to make only 10.166.0.3 to "share"/masq the same ip with the server. And now I have both 10.166.0.2 and 10.166.0.3 with the same ip, yeap its working but I need the second static ip to 10.166.0.2 and I dont know what to do...

Quoted 7 lines

Christos Panagiotakis

ps: forgive me for my awful english I hope to understand me

iptables -t nat -A POSTROUTING -s 10.166.0.3 -o eth0 -j SNAT --to $the_ip_address_wanted

That's if I understood you correct.

regards,
Georgi Alexandrov