LinuxQuestions.org
Help answer threads with 0 replies.
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 12-01-2004, 07:59 AM   #1
mikemrh9
Member
 
Registered: Nov 2003
Distribution: Arch
Posts: 136

Rep: Reputation: 21
Multiple IP Addresses


Hi.

I'm running SuSE 9.1 Pro and would like to permanently bind 2 static IP addresses to the same network card.

I can temporarily give myself a second address with:

ifconfig eth0:1 x.x.x.x netmask x.x.x.x

How do I make this permanent? I've had a look in /etc/sysconfig/network and the configuration file for my card is called: ifcfg-eth-id-00:d0:59:36:4a:39

It contains the following:

BOOTPROTO='static'
BROADCAST='76.255.255.255'
IPADDR='76.168.1.252'
MTU=''
NETMASK='255.0.0.0'
NETWORK='76.0.0.0'
REMOTE_IPADDR=''
STARTMODE='onboot'
UNIQUE='WL76.x+4TzbL0KL6'
_nm_name='bus-pci-0000:00:09.0'

I feel that I'm almost there - just searching for the missing link...

Do I edit this file in some way, or make a duplicate file called ifcfg-eth-id-00:d0:59:36:4a:39:1 and edit the address in the new file? If so, what does UNIQUE='WL76.x+4TzbL0KL6' do, and does it matter that it would no longer be unique?

Or is there a file somewhere that I can just add: ifconfig eth0:1 x.x.x.x netmask x.x.x.x to?

Mike.
 
Old 12-01-2004, 08:03 AM   #2
ror
Member
 
Registered: May 2004
Distribution: Ubuntu
Posts: 583

Rep: Reputation: 33
try /etc/rc.d/rc.inet1.conf (iirc, that's from memory, it's something around there tho )
 
Old 12-01-2004, 08:17 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You can create a script with the following 2 lines:
Code:
#! /bin/sh
ifconfig eth0:1 x.x.x.x netmask x.x.x.x
Copy it to /etc/init.d, make it executable and create a symlink for runlevel 5:
Code:
ln -s /etc/init.d/script /etc/init.d/rc5.d/S99script
 
Old 12-01-2004, 08:56 AM   #4
mikemrh9
Member
 
Registered: Nov 2003
Distribution: Arch
Posts: 136

Original Poster
Rep: Reputation: 21
Thanks to both of you for your help.

I tried bathory's solution and it worked fine.

I thought I'd got symlinks under control, but there is obviously more to them than meets the eye!

What is the significance of the first 3 characters, ie S99, K08 etc?

I've looked in the man pages, and also in info coreutils ln, but found no reference to these characters.

Mike.
 
Old 12-01-2004, 09:21 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
S is for start a service (through the script) and K for stopping it when you enter-exit that runlevel. The number is for the order the scripts are executed. Greater numbers mean latest execution. So S99 is the last script to run when you you enter that runlevel.
 
Old 12-01-2004, 09:29 AM   #6
mikemrh9
Member
 
Registered: Nov 2003
Distribution: Arch
Posts: 136

Original Poster
Rep: Reputation: 21
Brilliant.

Thanks!
 
Old 05-26-2005, 05:15 AM   #7
mikemrh9
Member
 
Registered: Nov 2003
Distribution: Arch
Posts: 136

Original Poster
Rep: Reputation: 21
While this is an excellent way to inadvertently learn about the init.d process, there is another, simpler solution to configuring multiple addresses.

Instructions can be found in /etc/sysconfig/network/ifcfg.template

The only slight caveot is that after doing this, the new addresses are not displayed by 'ifconfig'. however, you can use 'ip ethx' instead.
 
  


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
Multiple static IP addresses fr0zen Linux From Scratch 5 11-23-2005 06:47 PM
Multiple IP Addresses on Startup mikemrh9 SUSE / openSUSE 1 12-01-2004 09:01 AM
Multiple IP addresses james_cwy Linux - Newbie 6 06-13-2004 11:34 PM
Multiple IP addresses on one NIC hrr Linux - Networking 2 03-07-2003 12:04 PM
Multiple IP Addresses meshcurrent Linux - Networking 1 10-12-2002 05:11 AM

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

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