Visit Our UNIX and Linux User Community


configuring more than one ip for an inteface pemanently (linux)


 
Thread Tools Search this Thread
Special Forums IP Networking configuring more than one ip for an inteface pemanently (linux)
# 8  
Old 02-26-2002
Yeah after network stop and start the configurations are all gone. That's probably because ifconfig uses ioctl. I made a simple programm that uses ioctl for changing the IP, I can give it to you if you want, but after rebooting the new configurations are gone.
To tell you the truth I do not know why there are so many files doing the same thing. Probably because these configurations are vendor dependent. (Especially red hat tends to change everything, I still don't understand why they do not provide the kernel source code in /usr/src/linux)
# 9  
Old 03-05-2002
Re: configuring more than one ip for an inteface pemanently (linux)

The RedHat team uses a tool called linuxconf to configure the system, which is a control panel for all system services. Under te section Config/Networking/Server Tasks there is a line named IP Aliases for virtual hosts, where you can select the interface for which you want to make an alias. All you have to do is to add the IP address and the netmask and you're done. Changes are active just after reboot.

Quote:
Originally posted by hessam
Hi
does anybody know how we can add more than one ip for NIC(in Redhat Linux 7.2)?
i usually do it by using this command
ifconfig eth0 add <ip addresss> netmask <..............> up


or ;

ip address add 192.168.20.1/24 dev eth0


or
adding it manually to file in /etc/sysconfig/network-scripts
but their is no ifcfg-eth0 !!!!!
-------------------------------------------------------------
and it works cuz i can ping it from another machine


BUT when i reboot the machine all of the are gone.
I'm looking for way that these IPs can remain on the interface even after
reboot or shut down

is there anyone who can help me up?
# 10  
Old 03-28-2002
Quote:
Originally posted by developer
What you need to do is to add an alias to the interface, in order to do that, do the following. First go to the file /etc/sysconfig/networking/devices/ifcfg-eth0 and add the following lines:

DEVICE=eth0:1
ONBOOT=yes
BOOTPROTO=static
IPADDR= xxx.xxx.xxx.xxx
NETMASK=xxx.xxx.xxx.xxx
GATEWAY=xxx.xxx.xxx.xxx
TYPE=Ethernet
USERCTL=no
NETWORK=xxx.xxx.xxx.xxx
BROADCAST=xxx.xxx.xxx.xxx
PEERDNS=no
Where xxx.xxx.xxx.xxx put the apropriate addresses for your computer. After doing so go to the directory /etc/rc.d/init.d and type ./network stop; ./network start. That will initiate the new configurations. You can add as many IP addresses as you want by just doing the procedures above and changing the DEVICE:eth0:x from 1 to 2,3,... etc. and also by changing the IP address.
hi,
I have the same request on a SUN server, Can I do that safely ? Smilie
but where is the magic file to modify ?

Last edited by farzolito; 03-28-2002 at 05:19 AM..
# 11  
Old 03-29-2002
Yeah if you read the command above i think they work but maybe with a little bit of difference (see the man pages)
but the file you're looking for it to edit manually is not called (eth0)
I've forgotten the real name but ...
It should be something like prg0 or ....
# 12  
Old 03-29-2002
Tools

ok thx, the /etc/sysconfig/networking/devices/ifcfg-eth0 files doesn't exist on my OS that's why i found an other way to resolv it.

for my Sun Server with Solaris 8 :

I added an entry in /etc/hosts
xxx.xxx.xxx.xxx 'hostname'2

I already had the /etc/hostname.eri0
I created /etc/hostname.eri0:1
with in this file the 'hostname'2

and it's working Smilie
# 13  
Old 04-01-2002
Re: Re: configuring more than one ip for an inteface pemanently (linux)

there is another very good tool on redhat linux to configure your networking. "netconf" it's very simple to use.


Quote:
Originally posted by eNTer
The RedHat team uses a tool called linuxconf to configure the system, which is a control panel for all system services. Under te section Config/Networking/Server Tasks there is a line named IP Aliases for virtual hosts, where you can select the interface for which you want to make an alias. All you have to do is to add the IP address and the netmask and you're done. Changes are active just after reboot.


Previous Thread | Next Thread
Test Your Knowledge in Computers #848
Difficulty: Medium
The IEEE standardized Bluetooth as IEEE 802.15.1, but IEEE no longer maintains the Bluetooth standard.
True or False?

10 More Discussions You Might Find Interesting

1. Red Hat

Dot matrix Printer configuring on Linux RHEL AS 5.1

Dear Experts, We have requirement to configure Dot matrix printer in linux, Also need to register in Oracle application R12.0.6 version where i need get the print in landscape format. Request you all kindly help on the same. Thank you, Alone. ---------- Post updated 02-18-14 at 01:02... (6 Replies)
Discussion started by: Alone
6 Replies

2. IP Networking

Configuring DNS Server in Linux Redhat

Can someone help with a detail step-by-step oh how to configure DNS server on Linux Server. - I need to have 3 IP addresses map to a single hostname. for clients I'm a Linux rookie. Thanks Oscar (1 Reply)
Discussion started by: FrankOscar
1 Replies

3. Infrastructure Monitoring

Configuring SNMP in linux

I am trying to enabling SNMP access and trap forwarding for Linux(RHEL5) using following official url from IBM. http://publib.boulder.ibm.com/infocenter/eserver/v1r2/index.jsp?topic=/diricinfo/fqm0_t_enabling_snmp_access_and_trap_forwarding_for_linux.html In my system, snmp and snmplibs are... (1 Reply)
Discussion started by: SiddhV
1 Replies

4. IP Networking

Configuring Linux as a firewall

i have a linux server runnig oracle applications. i need to access this server from putty using ssh through internet. i did by registering my static ip with the dnydns.org and i am able to connect to the server. but now there is no security to authenticate any user as any one knowing the... (6 Replies)
Discussion started by: u.n.i.x
6 Replies

5. UNIX for Advanced & Expert Users

configuring NTP in Solaris/Windows/Linux environment.

Can anybody please explain the below table to monitor NTP daemon status This contains many columns like remote,refid,st....various values corresponding to those columns If possible provide me any link to study about these quantities clearly. It is very much required for my project please... (3 Replies)
Discussion started by: sgand
3 Replies

6. AIX

How to find the active network inteface on etherchannel

I have a server with multiple network interfaces. 2 of these interfaces, lets say en2 and en6 make up an etherchannel interface, which let's say en8. when I run the command lsattr -El ent8 I can see the designated primary and backup interfaces as ent6 and ent2, in the given order. But... (10 Replies)
Discussion started by: thenomad
10 Replies

7. Red Hat

Problem with configuring host name in Redhat Linux 5

Hi All when I give the command, $ ping <hostname> I get the following error ping: unknown host <hostname> I have checked in the following files, /etc/sysconfig/network /etc/hosts /etc/resolv.conf /etc/nsswitch.conf Every where in these files host name and IP address are given... (2 Replies)
Discussion started by: nagapradeep
2 Replies

8. Solaris

how to know inteface name in ULTRA 20

hi friends, I have brand new Sun Ultra 20 WS installed. It was preinstalled with Solaris 10 6/06 system, in ifconfig -a command only loop back intervace is showing. and /etc/path_to_install also not able to find the interface name. my questions are: 1. Is there any command to get... (1 Reply)
Discussion started by: subhankar
1 Replies

9. Shell Programming and Scripting

configuring 2-gateways in linux

Hi, I want to configure 2-gateways in Linux . Please tell me how I can achieve this. I am accesing 2-internet connection through these 2-gateways. So I am looking that if 1-gets down then also other one is working. Regards JAGDISH (1 Reply)
Discussion started by: jagdish.machhi@
1 Replies

10. Linux

Configuring USB in Red Hat Linux 9

Had problems in configuring USB memory stick in RHL 9. Please assist. With regards, Kungra. (1 Reply)
Discussion started by: kungra2006
1 Replies

Featured Tech Videos