LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   ifconfig on Network start/restart (https://www.linuxquestions.org/questions/linux-networking-3/ifconfig-on-network-start-restart-285372/)

chris1303 02-02-2005 11:19 AM

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

masand 02-02-2005 11:46 AM

u can put that in
/etc/rc.d/init.d/network script

BTW what ifconfg commands do u use???

regards

chris1303 02-02-2005 12:07 PM

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

Duudson 02-02-2005 12:44 PM

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)?

masand 02-02-2005 01:14 PM

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

chris1303 02-03-2005 04:21 AM

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

johnnydangerous 02-03-2005 06:16 AM

why is that need of ifconfig everytime? what is your intention?

chris1303 02-04-2005 03:21 AM

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


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