Skip to contentSkip to conversation

(no subject)

DISCUSSION saki 5 participants 5 messages Aug 20, 2002 – Sep 9, 2002

lore
Share & tools
lore

saki

author
#0 lore raw

hello i have internet cafe with 50 client and 1 server with 16 public address client1, client2, client3, client4 exit to ip.public.no.1 client5, client6, client7, client8 exit to ip.public.no.2 client9, client10, client11, client12 exit to ip.public.no.3
........
........
client ip address 192.168.1.1 - 192.168.1.50
public ip address 202.47.12.30 - 202.47.12.45

any one can help ?
i have installed redhat7.2 for server

#1 lore raw

Do you need it to map like that..or do you just want to do load balancing over the 16 ips ?
If you just need load balancing, then this command will do:

iptables -t nat -I POSTROUTING -s 192.168.1.0/26 \
-j SNAT --to 202.47.12.30-202.47.12.45

oh.. /26 is 64ips..but it's the closest to 50 you can get in one line

Are you using a class C netmask? if so..then just use /24 :)

-Robert.

Quoted 11 lines · saki

hello i have internet cafe with 50 client and 1 server with 16 public address client1, client2, client3, client4 exit to ip.public.no.1 client5, client6, client7, client8 exit to ip.public.no.2 client9, client10, client11, client12 exit to ip.public.no.3
........
........
client ip address 192.168.1.1 - 192.168.1.50
public ip address 202.47.12.30 - 202.47.12.45

any one can help ?
i have installed redhat7.2 for server

Signature · 2 lines
Robert Botha
jabber: [email protected]
#2 lore raw

Re: Multiple SNAT

In reply to saki
Quoted 11 lines · saki

hello i have internet cafe with 50 client and 1 server with 16 public address client1, client2, client3, client4 exit to ip.public.no.1 client5, client6, client7, client8 exit to ip.public.no.2 client9, client10, client11, client12 exit to ip.public.no.3
........
........
client ip address 192.168.1.1 - 192.168.1.50
public ip address 202.47.12.30 - 202.47.12.45

any one can help ?
i have installed redhat7.2 for server

iptables -A POSTROUTING -t nat -s 192.168.1.0/30 -j SNAT --to 202.47.12.30 iptables -A POSTROUTING -t nat -s 192.168.1.4/30 -j SNAT --to 202.47.12.31 iptables -A POSTROUTING -t nat -s 192.168.1.8/30 -j SNAT --to 202.47.12.32 iptables -A POSTROUTING -t nat -s 192.168.1.12/30 -j SNAT --to 202.47.12.33

etc.

Antony.

Signature · 1 line
If at first you don't succeed, destroy all the evidence that you tried.
#3 lore raw
In reply to saki

Ok, I never tried this but you could try these....
Also .30 and .45 can’t be used. They’re the network and broadcast respectively

Assuming eth0 is local net, ppp0 internet interface. Also, I don't allow the firewall/nat box to go onto the internet. If you want that you'll have to make lines for it. This is EXTREMELY!! basic.

iptables -F
iptables -t nat -F

iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP

iptables -A INPUT -s 127.0.0.1/8 -d 127.0.0.1/8 -i lo -j ACCEPT iptables -A OUTPUT -s 127.0.0.1/8 -d 127.0.0.1/8 -o lo -j ACCEPT

iptables -A FORWARD -s 192.168.1.0/24 -d 0/0 -i eth0 -o ppp+ -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s 0/0 -d 192.168.1.0/24 -i ppp+ -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT

iptables -A POSTROUTING -s 192.168.1.1 -o ippp+ -j SNAT --to-source 202.47.12.31
iptables -A POSTROUTING -s 192.168.1.2 -o ippp+ -j SNAT --to-source 202.47.12.31
iptables -A POSTROUTING -s 192.168.1.3 -o ippp+ -j SNAT --to-source 202.47.12.31
iptables -A POSTROUTING -s 192.168.1.4 -o ippp+ -j SNAT --to-source 202.47.12.31
iptables -A POSTROUTING -s 192.168.1.5 -o ippp+ -j SNAT --to-source 202.47.12.32
iptables -A POSTROUTING -s 192.168.1.6 -o ippp+ -j SNAT --to-source 202.47.12.32
iptables -A POSTROUTING -s 192.168.1.7 -o ippp+ -j SNAT --to-source 202.47.12.32
iptables -A POSTROUTING -s 192.168.1.8 -o ippp+ -j SNAT --to-source 202.47.12.32
iptables -A POSTROUTING -s 192.168.1.9 -o ippp+ -j SNAT --to-source 202.47.12.33
iptables -A POSTROUTING -s 192.168.1.10 -o ippp+ -j SNAT --to-source 202.47.12.33
iptables -A POSTROUTING -s 192.168.1.11 -o ippp+ -j SNAT --to-source 202.47.12.33
iptables -A POSTROUTING -s 192.168.1.12 -o ippp+ -j SNAT --to-source 202.47.12.33
iptables -A POSTROUTING -s 192.168.1.13 -o ippp+ -j SNAT --to-source 202.47.12.34
iptables -A POSTROUTING -s 192.168.1.14 -o ippp+ -j SNAT --to-source 202.47.12.34
iptables -A POSTROUTING -s 192.168.1.15 -o ippp+ -j SNAT --to-source 202.47.12.34
iptables -A POSTROUTING -s 192.168.1.16 -o ippp+ -j SNAT --to-source 202.47.12.34
iptables -A POSTROUTING -s 192.168.1.17 -o ippp+ -j SNAT --to-source 202.47.12.35
iptables -A POSTROUTING -s 192.168.1.18 -o ippp+ -j SNAT --to-source 202.47.12.35
iptables -A POSTROUTING -s 192.168.1.19 -o ippp+ -j SNAT --to-source 202.47.12.35
iptables -A POSTROUTING -s 192.168.1.20 -o ippp+ -j SNAT --to-source 202.47.12.35
iptables -A POSTROUTING -s 192.168.1.21 -o ippp+ -j SNAT --to-source 202.47.12.36
iptables -A POSTROUTING -s 192.168.1.22 -o ippp+ -j SNAT --to-source 202.47.12.36
iptables -A POSTROUTING -s 192.168.1.23 -o ippp+ -j SNAT --to-source 202.47.12.36
iptables -A POSTROUTING -s 192.168.1.24 -o ippp+ -j SNAT --to-source 202.47.12.36
iptables -A POSTROUTING -s 192.168.1.25 -o ippp+ -j SNAT --to-source 202.47.12.37
iptables -A POSTROUTING -s 192.168.1.26 -o ippp+ -j SNAT --to-source 202.47.12.37
iptables -A POSTROUTING -s 192.168.1.27 -o ippp+ -j SNAT --to-source 202.47.12.37
iptables -A POSTROUTING -s 192.168.1.28 -o ippp+ -j SNAT --to-source 202.47.12.37
iptables -A POSTROUTING -s 192.168.1.29 -o ippp+ -j SNAT --to-source 202.47.12.38
iptables -A POSTROUTING -s 192.168.1.30 -o ippp+ -j SNAT --to-source 202.47.12.38
iptables -A POSTROUTING -s 192.168.1.31 -o ippp+ -j SNAT --to-source 202.47.12.38
iptables -A POSTROUTING -s 192.168.1.32 -o ippp+ -j SNAT --to-source 202.47.12.38
iptables -A POSTROUTING -s 192.168.1.33 -o ippp+ -j SNAT --to-source 202.47.12.39
iptables -A POSTROUTING -s 192.168.1.34 -o ippp+ -j SNAT --to-source 202.47.12.39
iptables -A POSTROUTING -s 192.168.1.35 -o ippp+ -j SNAT --to-source 202.47.12.39
iptables -A POSTROUTING -s 192.168.1.36 -o ippp+ -j SNAT --to-source 202.47.12.39
iptables -A POSTROUTING -s 192.168.1.37 -o ippp+ -j SNAT --to-source 202.47.12.40
iptables -A POSTROUTING -s 192.168.1.38 -o ippp+ -j SNAT --to-source 202.47.12.40
iptables -A POSTROUTING -s 192.168.1.39 -o ippp+ -j SNAT --to-source 202.47.12.40
iptables -A POSTROUTING -s 192.168.1.40 -o ippp+ -j SNAT --to-source 202.47.12.40
iptables -A POSTROUTING -s 192.168.1.41 -o ippp+ -j SNAT --to-source 202.47.12.41
iptables -A POSTROUTING -s 192.168.1.42 -o ippp+ -j SNAT --to-source 202.47.12.41
iptables -A POSTROUTING -s 192.168.1.43 -o ippp+ -j SNAT --to-source 202.47.12.41
iptables -A POSTROUTING -s 192.168.1.44 -o ippp+ -j SNAT --to-source 202.47.12.41
iptables -A POSTROUTING -s 192.168.1.45 -o ippp+ -j SNAT --to-source 202.47.12.42
iptables -A POSTROUTING -s 192.168.1.46 -o ippp+ -j SNAT --to-source 202.47.12.42
iptables -A POSTROUTING -s 192.168.1.47 -o ippp+ -j SNAT --to-source 202.47.12.42
iptables -A POSTROUTING -s 192.168.1.48 -o ippp+ -j SNAT --to-source 202.47.12.42
iptables -A POSTROUTING -s 192.168.1.49 -o ippp+ -j SNAT --to-source 202.47.12.43
iptables -A POSTROUTING -s 192.168.1.50 -o ippp+ -j SNAT --to-source 202.47.12.43

And 6 future hosts left to connect...

Met vriendelijke groet,

Ferry van Steen
InfoPart Automatisering B.V.
Beeksestraat 24
4841 GC Prinsenbeek
Tel: 076 - 5 44 04 11
Fax: 076 - 5 41 83 51
Mobiel: 06 - 28 46 47 45
E-Mail (zaak): [email protected]
E-Mail (prive): [email protected]
MSN Messenger: [email protected]
ICQ (UIN (zelden gebruikt)): 191458

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of saki
Sent: dinsdag 20 augustus 2002 22:56
To: [email protected]
Subject: (no subject)

hello  i have internet cafe with 50 client and 1 server with 16 public address
client1, client2, client3, client4  exit to ip.public.no.1 client5, client6, client7, client8  exit to ip.public.no.2 client9, client10, client11, client12  exit to ip.public.no.3
........
........
client ip address 192.168.1.1 - 192.168.1.50
public ip address 202.47.12.30 - 202.47.12.45

any one can help ?
i have installed redhat7.2 for server

#4 lore raw
In reply to saki
Quoted 6 lines · saki

hello i have internet cafe with 50 client and 1 server with 16 public address
client1, client2, client3, client4 exit to ip.public.no.1 client5, client6, client7, client8 exit to ip.public.no.2 client9, client10, client11, client12 exit to ip.public.no.3
........
........
client ip address 192.168.1.1 - 192.168.1.50
public ip address 202.47.12.30 - 202.47.12.45

<sarcasm>
Facinating.
</sarcasm>

Quoted 2 lines

any one can help ?

<sarcasm>
Yes, but the question is will they and how.
</sarcasm>

Please state a full description of your problem, and especially what steps you have takes in order to solve it. All we got is some vague description of your networking setup, and Linux distribution.

Signature · 3 lines
Neo: 'Can you fly that thing?'
Trinity: 'Not yet'.
$ apt-get install pilot-prg-v212helicopter.