LinuxQuestions.org
Visit Jeremy's Blog.
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 05-11-2005, 01:53 PM   #1
Ougle
LQ Newbie
 
Registered: May 2005
Distribution: Mainly SuSE
Posts: 21

Rep: Reputation: 15
Setting a second IP address to the same device.


Hi,

I have apache2 running and am playing with virtual hosts and having 192.168.1.255 and 192.168.1.254 (and 192.168.1.253 etc) as two (or more) hosts so that they can point to different websites.

For the virtual hosts to work I have to add the IP address to the ethernet device using the following command.
Code:
/sbin/ifconfig eth0:0 192.168.1.254

But I have to do that before Apache is started.
Is there a way that I can have the computer do that command when it boots up before it starts Apache?
 
Old 05-11-2005, 02:08 PM   #2
michaelsanford
Member
 
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30
I don't know about SUSE specifically but Slackware has /etc/rc.d/rc.local for local custom startup commands.

Check around for something similar, and put the command there (or wait for someone who knows SUSE to tell you )
 
Old 05-11-2005, 03:40 PM   #3
Imanerd
Member
 
Registered: Dec 2004
Location: Bay Area, California
Distribution: Fedora Core 3
Posts: 65

Rep: Reputation: 15
I only know how to do it graphically, but on FC3 with GDE, you can use system-config-network to add a new (logical) ethernet device and give it any IP address you want. Then just check the box that says, "activate this device when computer starts". But it seems like it would be easier for you to use name based virtual hosting and run all the sites on the same IP address.

Sorry I can't be more helpful, but I'm a newbie at this stuff myself.

Last edited by Imanerd; 05-11-2005 at 03:42 PM.
 
Old 05-12-2005, 05:52 AM   #4
Ougle
LQ Newbie
 
Registered: May 2005
Distribution: Mainly SuSE
Posts: 21

Original Poster
Rep: Reputation: 15
Graphically is good, I am a newbie too (although being a programmer I dont mind text if I have instructions)

Ive gone to the YAST control centre and to yast-system-config and looked at most of the settings including the ones in hardware-network.
I think I might have to set a setting to run a script and then go and edit that script.


I'll have another look later but in the mean time anyone who knows SuSE would really help.
 
Old 05-12-2005, 06:31 AM   #5
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32
Hi,

here it is : http://portal.suse.com/sdb/en/2002/0...network80.html
they explain what config files are used at boot time and how to configure them.

as for the alias, have a look at :
http://www.ambidexter.com/unix-model/redhatip.htm

Last edited by fr_laz; 05-12-2005 at 06:43 AM.
 
Old 05-12-2005, 07:02 AM   #6
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
Don't configure a host with 192.168.1.255, this is a broadcast address for the 192.168.1.0 network and you will get all sort of weirdities if you attempt to connect to it.
 
Old 05-12-2005, 12:09 PM   #7
Ougle
LQ Newbie
 
Registered: May 2005
Distribution: Mainly SuSE
Posts: 21

Original Poster
Rep: Reputation: 15
Thanks, those links helped and I made my config file needed. It works great, I got to see it set the IP address as I watched it quickly boot up everything.

I did relise later that 192.168.1.255 was my broadcast address and not my default IP address as I had thought. Thanks for the warning though pete.
 
  


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
dd: /dev/hda: No such device or address securehack Linux - General 97 06-04-2005 07:27 PM
USB Device not accepting address systemparadox Linux - Hardware 2 08-24-2004 10:00 AM
CDEMU: [errno6] No such device or address leadazide Linux - Software 5 07-25-2004 12:52 PM
loop: can't open device /dev/loop0: No such device or address miaviator278 Linux - Security 3 06-09-2004 09:24 PM
How to get the address of a device eshwar_ind Programming 0 02-06-2004 06:52 AM

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

All times are GMT -5. The time now is 06:36 PM.

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