Solved

Using a linux router for public IPs

Posted on 2003-12-10
5
296 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 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Simple Router Management, Subnets and VLANs e.g. RV0xx 7 76
HP network exams 3 62
VLAN Issue 4 75
Understanding Extended-Access List 6 39
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.
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
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…

730 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