Solved

Using a linux router for public IPs

Posted on 2003-12-10
5
290 Views
Last Modified: 2013-11-29
Hi,

I have a net connection which comes to me through LAN. I have got public IPs. The lan card is installed on Linux server for further distributing using NAT. The internal network of computers in my organisation are using private IPs.

I currently have 7 more public IPs left which I can use. My question is how can I add seven PCs in my network having public IPs through my Linux server, and also continue the NAT for the existing PCs with private IPs. Do I have to add another LAN card?

Also what will be better to use in my situation, Windows XP or Linux.

Thanx in advance
0
Comment
Question by:abhinaysinha
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
Jivko earned 200 total points
ID: 9911553
You can use SOURCE and DESTINATION NAT

1.Put all of the 8 public IPs to your external interface , for example eth0

ifconfig eth0 <first_public_ip> netmask 255.255.255.xxx
ifconfig eth0:1 <second_public_ip> netmask 255.255.255.xxx
ifconfig eth0:3 <third_public_ip> netmask 255.255.255.xxx
..........................................................................
...........................................................

Then :
iptables -t nat -I PREROUTING -d <first_public_ip> -j DNAT --to-destination <first_internal_ip>
iptables -t nat -I POSTROUTING -s <first_internal_ip> -j SNAT --to-source <first_public_ip>

.....

And so on
0
 
LVL 1

Author Comment

by:abhinaysinha
ID: 9913087
OK. So that means the computers will be added to the internal interface, say eth1, and have private IPs. But will they work same as any computer directly connected to net with a public IP or they will have some limitations.
0
 
LVL 4

Expert Comment

by:Jivko
ID: 9918664
There will be no limitations
If you want limitations you can do this by netfilter-iptables

Regards
0
 
LVL 1

Author Comment

by:abhinaysinha
ID: 9919185
Can this be done in windows XP?

Secondly, I am comfortable with ipchains. My knowledge about iptables is nil. can this be converted to ipchains?
0
 
LVL 4

Expert Comment

by:Jivko
ID: 9919296
This can NOT be done by windows XP.

Ipchains scenario- not so good - this is not a full NAT solution

http://www.ox.compsoc.org.uk/~steve/portfw-2.2.html

$EXTIF=eth0
$INTLAN=192.168.0./24
ipchains -A forward -i $EXTIF -s $INTLAN -j MASQ

#PORTFORWARDING
#echo "Enabling IPPORTFW Redirection on the external LAN.."
#
#   This will forward ALL port 80 traffic from the external IP address
#   to port 80 on the 192.168.0.10 machine
#
PORTFWIP="192.168.0.10"

/usr/sbin/ipmasqadm portfw -f
/usr/sbin/ipmasqadm portfw -a -P tcp -L $EXTIP 80 -R $PORTFWIP 80

Use iptables , ipchains and 2.2 kernels are obsolete



0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now