LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-10-2001, 06:57 PM   #1
INS
LQ Newbie
 
Registered: Mar 2001
Posts: 5

Rep: Reputation: 0
Question


I am running RH7.0 server. I have recently gotten a range of static IP's. I need to configure my RH box to work in my existing network, but also need it to work w/ one of the static IP's.

Things were running fine, until I got the static IP's and my default gateway changed from 10.1.2.1 to 63.230.123.214. I have seen posts that a NIC can have 2 IP's in Linux (heck it was easy for me on NT) but being new to Linux I am lost. I have tried multiple "settings" in linuxconf, but none really work as needed.

With it's original ip (10.1.1.2) my internal network "sees" the system fine, but mail won't transfer to the outside world and the web does not work either. If I change the IP to the external one, the web works but then my local systems can't find the mail server to send mail.

Help! Please.... I don't mind reading so even a link would help, which I will be looking for next.

Thank you any and all in advance,
INS aka Henry
 
Old 04-10-2001, 09:12 PM   #2
INS
LQ Newbie
 
Registered: Mar 2001
Posts: 5

Original Poster
Rep: Reputation: 0
Smile found it

I did find the answer on a RedHat discussion form. But for those of you woundering the same thing here is what I found:

[SNIP]

It is actually just about as easy as it is in NT. It is called IP aliasing, and Red Hat compiles it into their kernels. It works almost the same as a normal interface *except* the statistics are for the physical card, not each individual IP address. So if I wanted to setup an IP alias on eth0 I would create a file:

/etc/sysconfig/network-scripts/ifcfg-eth0:0

And that file might look something like this:

DEVICE=eth0:0
BOOTPROTO=none
IPADDR=192.168.0.2
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
GATEWAY=192.168.0.254
USERCTL=no

Then restart your networking (/etc/rc.d/init.d/network restart). IP aliasing is entirely virtual, so no modules need to be loaded or anything like that (although the ip_alias code can be compiled as a module and loaded that way as well). You can check the interface like this:

ifconfig eth0:0

and it will report the setup of the interface. Once you're done with that and the IP address is working properly, you can set up the IP-based virtual hosting in httpd.conf.

[SNIP]

I forgot to add:

ONBOOT=yes

to the above configuration.



The only change I made to the above instructions was that I setup the external IP as the "main" IP of the system and setup the alias (eth0:0) to be my internal. I don't think I had to, but it works. That is all that matters right????
OK, I will probably double chek that later to find out for sure.

The actual web link is:
https://www.redhat.com/WebX?13@67.Ky...N^1@.ee6c672/0

Thanx again,
INS
 
Old 01-28-2004, 04:18 AM   #3
crnaik
LQ Newbie
 
Registered: Jan 2004
Location: India
Posts: 1

Rep: Reputation: 0
Is anything more need????

I have also tried with the same but it is not working at my side. Is anything more needed to configure two IP addresses on a single NIC???

Though I am setting up one internal and one external IP address.

Thank You
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Binding named to only one NIC of a dual NIC machine - possible? Paul_Randle Linux - Networking 3 08-24-2005 08:44 AM
assigning multiple ip's to nic ? pingu_penguin Linux - Networking 2 05-14-2005 09:00 PM
Gateway setting for dual NIC cards? Moonman Red Hat 4 02-02-2005 01:28 AM
Multiple ip's for same NIC hvdwatt Linux - Newbie 5 08-03-2003 04:33 AM
Multiple IP's on the 1 NIC dicka_j Linux - Hardware 4 04-07-2003 11:49 PM

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

All times are GMT -5. The time now is 02:02 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