LinuxQuestions.org
Visit Jeremy's Blog.
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 02-02-2005, 11:19 AM   #1
chris1303
LQ Newbie
 
Registered: Feb 2005
Location: Edinburgh, Scotland
Posts: 4

Rep: Reputation: 0
ifconfig on Network start/restart


I am running fedora Core 3 and have several ifconfig commands I am currently entering manually.

What would be the "correct" way to script/install these commands to run automatically any time the Network service starts/restarts?

Chris
 
Old 02-02-2005, 11:46 AM   #2
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
u can put that in
/etc/rc.d/init.d/network script

BTW what ifconfg commands do u use???

regards
 
Old 02-02-2005, 12:07 PM   #3
chris1303
LQ Newbie
 
Registered: Feb 2005
Location: Edinburgh, Scotland
Posts: 4

Original Poster
Rep: Reputation: 0
I was unsure about entering the details into this script, I will read some documentation if I can find it.

What I am doing is creating a list of interfaces like this:

ifconfig eth1:1 266.123.54.996 netmask 255.255.255.240 up
ifconfig eth1:2 266.123.54.997 netmask 255.255.255.240 up
ifconfig eth1:3 266.123.54.998 netmask 255.255.255.240 up

to create virtual interfaces. Should I be doing this in some other way?

Chris
 
Old 02-02-2005, 12:44 PM   #4
Duudson
Member
 
Registered: Dec 2004
Distribution: RHEL3, FC3
Posts: 53

Rep: Reputation: 15
Create files e.g. /etc/sysconfig/network-scripts/ifcfg-eth1:1 with content
IPADDR=10.1.1.1
NETMASK=255.255.255.0
ONBOOT=yes



Then give command service network restart


btw, I hope you are not using those addresses (266.123.54.996)?
 
Old 02-02-2005, 01:14 PM   #5
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
Quote:
Originally posted by Duudson
Create files e.g. /etc/sysconfig/network-scripts/ifcfg-eth1:1 with content
IPADDR=10.1.1.1
NETMASK=255.255.255.0
ONBOOT=yes



Then give command service network restart


btw, I hope you are not using those addresses (266.123.54.996)?


that will be fine i think

u can have alook at some other network scripts to look for more options other than these

regards
 
Old 02-03-2005, 04:21 AM   #6
chris1303
LQ Newbie
 
Registered: Feb 2005
Location: Edinburgh, Scotland
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Duudson
Create files e.g. /etc/sysconfig/network-scripts/ifcfg-eth1:1 with content
IPADDR=10.1.1.1
NETMASK=255.255.255.0
ONBOOT=yes



Then give command service network restart


btw, I hope you are not using those addresses (266.123.54.996)?
(Re: ip numbers - No - they were duds I plugged in - should have clarified that)

This is exactly the solution I tried unsuccessfully before posting - I wll go away and check I had done it correctly!

I could not quickly figure out where the devices list was derived from used in the networking scripts, it did not seem to pick up these files in the network-scripts directory. I had given them rw- r-- r-- permissions which were the same as the ifcfg-eth0 and ifcfg-eth1 files had.

Many thanks for your responses.

Chris
 
Old 02-03-2005, 06:16 AM   #7
johnnydangerous
Member
 
Registered: Jan 2005
Location: Sofia, Bulgaria
Distribution: Fedora Core 4 Rawhide
Posts: 431

Rep: Reputation: 30
Lightbulb

why is that need of ifconfig everytime? what is your intention?
 
Old 02-04-2005, 03:21 AM   #8
chris1303
LQ Newbie
 
Registered: Feb 2005
Location: Edinburgh, Scotland
Posts: 4

Original Poster
Rep: Reputation: 0
Hello,

My intention was to create virtual interfaces for records in DNS when the machine only actually has 2 network devices.

Am I overlooking something simple!

Chris
 
  


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
how can i start, stop or restart Paxmaster Slackware 3 11-27-2004 01:31 PM
Network not accessible after boot; OK after network restart chriswei Linux - Networking 5 09-22-2004 10:16 PM
Synaptic will not start after restart! Oh Cisco Debian 8 07-29-2004 11:44 AM
Samba - Start or Restart? Charlie Spencer Linux - Networking 5 11-22-2003 10:39 AM
sshd start & restart JeRrYmAn Linux - Newbie 3 10-07-2003 09:05 AM


All times are GMT -5. The time now is 03:27 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration