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 09-28-2003, 06:24 AM   #1
hampel
Member
 
Registered: Jun 2003
Posts: 62

Rep: Reputation: 15
ifconfig up/down ->Expert question


Hello,

i can activate / deactivate an interface with ifconfig.
eg:
ifconfig down eth0
ifconfig up eth0

But where does ifconfig store the information about eth0 (like ip adress) so that i can do a "ifconfig up eth0" after a "ifconfig down eth0" ?

regards
 
Old 09-28-2003, 08:35 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
I think it can vary a bit between distros but take a look in:
/etc/sysconfig/network-scripts/
 
Old 09-29-2003, 01:13 AM   #3
hampel
Member
 
Registered: Jun 2003
Posts: 62

Original Poster
Rep: Reputation: 15
perhaps, but i don't think so because look at the content of this file:
Where sould ifconfig know the correct line for interface eth0?? What is if i will have more than only 2 interfaces??
Any idea?

# eth0
IPADDR1="192.100.1.7" # REPLACE with YOUR IP address!
NETMASK1="255.255.255.255" # REPLACE with YOUR netmask!

# eth1
IPADDR2="192.100.1.8" # REPLACE with YOUR IP address!
NETMASK2="255.255.255.255" # REPLACE with YOUR netmask!
 
Old 09-29-2003, 01:17 AM   #4
ehdwuld
Member
 
Registered: Jul 2003
Distribution: Currently Suse 11.1 but have RH7,8,9 / Fedora 7,8_64,9_64,&10_64
Posts: 634

Rep: Reputation: 30
then the config would read
# eth2
# eth3

etc,etc
 
Old 09-30-2003, 01:00 AM   #5
hampel
Member
 
Registered: Jun 2003
Posts: 62

Original Poster
Rep: Reputation: 15
thanks for your answer but:

if i shutdown eth0 + eth1:

ifconfig eth0 down
ifconfig eth1 down

and entries in my 'network config file' are:

# eth0
IPADDR1="192.100.1.7" # REPLACE with YOUR IP address!
NETMASK1="255.255.255.255" # REPLACE with YOUR netmask!

# eth1
IPADDR2="192.100.1.8" # REPLACE with YOUR IP address!
NETMASK2="255.255.255.255" # REPLACE with YOUR netmask!

An 'ifconfig eth1 up' would give 'eth1' the ip adress of 'IPADDR2'!
@ehdwuld: if you would be right, this command should give 'eth1' the ip adress of 'IPADDR1' and not of 'IPADDR2'!

please help
 
Old 09-30-2003, 01:29 AM   #6
ehdwuld
Member
 
Registered: Jul 2003
Distribution: Currently Suse 11.1 but have RH7,8,9 / Fedora 7,8_64,9_64,&10_64
Posts: 634

Rep: Reputation: 30
Quote:
( post #3)

perhaps, but i don't think so because look at the content of this file:
Where sould ifconfig know the correct line for interface eth0?? What is if i will have more than only 2 interfaces??
Any idea?

# eth0
IPADDR1="192.100.1.7" # REPLACE with YOUR IP address!
NETMASK1="255.255.255.255" # REPLACE with YOUR netmask!

# eth1
IPADDR2="192.100.1.8" # REPLACE with YOUR IP address!
NETMASK2="255.255.255.255" # REPLACE with YOUR netmask!
ok
please I donot under stand your strange customs
your question was " where is this stored "
you asked for an expert opinion
you got one
you said " I don't think so "
you you are now the expert?

hmmmm

any ways
if you had " more " interfaces on your box
it would read

# eth0
IPADDR1="192.100.1.7" # REPLACE with YOUR IP address!
NETMASK1="255.255.255.255" # REPLACE with YOUR netmask!

# eth1
IPADDR2="192.100.1.8" # REPLACE with YOUR IP address!
NETMASK2="255.255.255.255" # REPLACE with YOUR netmask!

# eth2
IPADDR3="192.100.1.9" # REPLACE with YOUR IP address!
NETMASK1="255.255.255.255" # REPLACE with YOUR netmask!

# eth3
IPADDR4="192.100.1.10" # REPLACE with YOUR IP address!
NETMASK2="255.255.255.255" # REPLACE with YOUR netmask!



please explain the part you are not understanding???


numbering of the interfaces starts at 0, 1, 2, etc......
numbering of the addresses follow conventional schemes starting at 1, 2, 3, etc........

Last edited by ehdwuld; 09-30-2003 at 01:31 AM.
 
Old 09-30-2003, 09:03 AM   #7
zigmund555
Member
 
Registered: Sep 2003
Location: Maryland
Distribution: Slackware -current
Posts: 87

Rep: Reputation: 15
I think what ehd is try to say is the file pulls the info from IPADDR1 and applies it to eth0. IPADDR2 would apply to eth1.
 
Old 10-01-2003, 10:44 AM   #8
hampel
Member
 
Registered: Jun 2003
Posts: 62

Original Poster
Rep: Reputation: 15
But if you have read my last reply, you would understand the problem!
that eth0 doesn't get the ip adress of IPADDR1!!!
 
Old 10-01-2003, 10:48 AM   #9
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
The order of the network cards is assigned by the kernel in the order they were discovered. Look at the output from dmesg. As long as you don't move the cards around in the expansion slots, the order will always be the same.
 
Old 10-01-2003, 10:58 AM   #10
yocompia
Member
 
Registered: Apr 2003
Location: Chicago, IL
Distribution: openbsd 3.6, slackware 10.0
Posts: 244

Rep: Reputation: 30
ok, maybe i don't fully understand this drama, as i don't have to take my interfaces up and down regularly, but i see a quick solution:

write a script for restoring the interfaces so that the interfaces are labelled consistently, i.e. always put "/sbin/ifconfig eth0 <IP of eth0> broadcast <blah> netmask <blah>" BEFORE you pull up eth1.

that should work, and it might even leave the interfaces that are already up alone (i.e. not interrupt transfers through them). so instead of using "ifconfig eth1 up", link the script into your $PATH so you can issue "putemup" from the CL to put all interfaces back online.

HTH,
y-p
 
Old 10-01-2003, 11:36 AM   #11
ehdwuld
Member
 
Registered: Jul 2003
Distribution: Currently Suse 11.1 but have RH7,8,9 / Fedora 7,8_64,9_64,&10_64
Posts: 634

Rep: Reputation: 30
Quote:
192.100.1.7

is the problem that it address is not
192.100.1.1
?????????

why?

if your network's
internal dhcp server sees itself first
it gets 192.100.1.1
then it see your router
it gets 192.100.1.2
then it discovers your buddies PC
it gets 192.100.1.3
and on and on
until it reaches to the ports on your box
which it labels 192.100.1.7, 192.100.1.8 , etc
its all part of the discovery protocols
read up on DHCP

maybe there you will find the answer

maybe the network block starts at something other than
192.100.1.0

in which case the range of available addresses would be different

Edit
could be the order in which they are plugged into the switch
maybe your network printer is
192.100.1.1

Last edited by ehdwuld; 10-01-2003 at 11:41 AM.
 
  


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
Question for RAM and/or Mobo expert PC_Pal68 Linux - Hardware 10 02-27-2005 08:50 AM
Gnome themes... embarasing question from a should be linux expert. qwijibow Linux - Newbie 4 01-20-2005 06:02 PM
ifconfig question blackzone Linux - Networking 2 09-15-2004 03:19 AM
please help - ifconfig/ethernet question JamesM Linux - Networking 3 07-25-2003 08:10 AM
ifconfig expert question hampel Linux - Networking 2 06-25-2003 03:16 AM

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

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