LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-08-2003, 09:11 AM   #1
ehpserver
Member
 
Registered: Sep 2003
Posts: 38

Rep: Reputation: 15
Unhappy 2 live/public ips for single NIC


HI,

Good day to all.

MY q:

Redhat 9.0/p-4

I got 2 live/public ips ( 202.50.x.x , 202.51.x.x) with different gateways. Now iam using 202.50.x.x to browse internet ,now i want to assign the 2 ip 202.51.x.x also for same network card. How can ?

finally :

i want to assign 202.50.x.x Gateway:202.50.1.x AND 202.51.x.x
Gateway 202.51.1.x to same NIC , how can i ?

-Thanks for your time.
 
Old 10-08-2003, 10:52 AM   #2
jrmann1999
Member
 
Registered: Feb 2001
Location: Texas
Distribution: Slackware, Mandrake, LFS
Posts: 306

Rep: Reputation: 30
Just so you know, the system can only have 1 default gateway associated with it so if you're looking to load balance across these two nics, you'll need a different solution, that being said:


To configure the base ethernet address I assume you know the ifconfig utility:

ifconfig eth# <ipaddress> netmask <mask> gw <gateway>
ex.
ifconfig eth0 192.168.1.2 netmask 255.255.255.0 gw 192.168.1.1

to alias additional ips you simply append a : and #, like

ifconfig eth#:# <ipaddress> netmask <mask> gw <gateway>
ex.
ifconfig eth0:0 192.168.2.2 netmask 255.255.255.0 gw 192.168.2.1

You'll notice your routing tables will automatically setup to route 192.168.2.x traffic to the 192.168.2.1 gateway, similar for the first set of ip addresses.
 
Old 10-08-2003, 03:18 PM   #3
ehpserver
Member
 
Registered: Sep 2003
Posts: 38

Original Poster
Rep: Reputation: 15
HI,.
THanks for your reply and time. I follwd the link and done eth1:0


http://www.redhat.com/docs/manuals/l...k-aliases.html

My problem is linux is taking ip which added using ip alias as primary ip and trying get net using that . But i want it to use my main ip ( which is first ip of my lan card ) . how can i ?


and as these are real / public ips with 2 different gateways and subnets , is it possible that my system can be view by rest of the world using both of these ips ??

plz help me and thanks for your time
 
Old 10-08-2003, 07:00 PM   #4
jrmann1999
Member
 
Registered: Feb 2001
Location: Texas
Distribution: Slackware, Mandrake, LFS
Posts: 306

Rep: Reputation: 30
Yes you can be accessed by both public IP addresses. To make your traffic go out your primary IP just make the default gateway whichever associates with that one, like:

if you had two subnets, 192.168.1.x and 192.168.2.x
assume gateways of 192.168.1.254 and 192.168.2.254 respectively

route add default gw 192.168.1.254
vice versa for 2
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Max # of IPs on a single NIC Risc91 Red Hat 3 03-14-2005 03:32 PM
two public ips on one nic for home office dns servers rioguia Linux - Networking 12 08-19-2004 03:59 PM
binding multiple IPs to single NIC? lok1 Linux - Networking 2 11-16-2003 02:58 PM
Sharing two public IPs. Unseen Linux - Networking 8 03-20-2003 01:17 PM
Multiple NIC cards - public and private IPs harryinjapan Linux - Networking 2 12-02-2001 04:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration