[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Using a linux router for public IPs

Posted on 2003-12-10
5
Medium Priority
?
309 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
Jivko earned 800 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For many of us, the  holiday season kindles the natural urge to give back to our friends, family members and communities. While it's easy for friends to notice the impact of such deeds, understanding the contributions of businesses and enterprises i…
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
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…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

649 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