LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-19-2007, 10:00 AM   #1
Verve1986
LQ Newbie
 
Registered: Nov 2007
Posts: 6

Rep: Reputation: 0
Question activating NIC only with ifup?


Hallo together,

my company decided to test the use of linux on database servers. My colleagues and me play around with oracle linux (based on RHEL5, afaik) at the moment and configure the network.

We heard in a short introduction that network interfaces can be configured with ip and ifconfig.

Bringing eth0 down with these commands (ifconfig eth0 down and ip link set eth0 down) work as they should. When we try ifconfig eth0 up or ip link set eth0 up, we get no error message. But when we try to ping another host, it tells us that the network is not reachable.

The only way to reactivate the interface is using the ifup eth0 command - the only one of the three, which has no manpage (which I found rather odd).

Is this normal or did I misinterpret the manpages of ifconfig and ip? English is not my first language, so I might have misunderstood something..

Thanks in advance!

PS: I searched google and used the forum search, but you don't get many useful links when looking for "ip link set up" or "ifconfig"... especially when "ip" and "up" are not possible to search for in the forum because they're to short.
So please don't jump on me if the question has already been answered here, I tried my best

Last edited by Verve1986; 11-19-2007 at 10:10 AM.
 
Old 11-19-2007, 12:47 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
Quote:
Originally Posted by Verve1986 View Post
Bringing eth0 down with these commands (ifconfig eth0 down and ip link set eth0 down) work as they should. When we try ifconfig eth0 up or ip link set eth0 up, we get no error message. But when we try to ping another host, it tells us that the network is not reachable.
This is normal… you need to do something in addition to putting the interface in “up” mode in order to use it, but in order not to use it, all you really need to do is put it in “down” mode. I hope that makes sense.

So as an example, this is how you might bring up an interface:
Code:
ifconfig eth0 10.9.8.7 netmask 255.255.255.0 up
OR
Code:
ip link set dev eth0 up
ip addr add 10.9.8.7/24 brd + dev eth0
Obviously, this is for a certain static IP address on a certain network. Both these methods should automatically add a route to the relevant network (you can also accomplish this manually using the “route” or “ip route” commands). The second command illustrates my original point more clearly: to be able to use an interface, you need to bring it “up” on the hardware (link) level, and then assign an address to it on the network level. When you want to stop using it, all you need to do is bring it “down” on the link level, and the network level will (usually) automatically disappear.

The other commands (ifup) and (ifdown) are usually not binary executables, but actually scripts. The reason they have no standard manpages is that each distribution has their own version (but that should not bar a specific distribution from provided specific documentation for their specific scripts). These scripts usually take care of the work for you. They scan some config files to determine whether you want to assign a static address or use DHCP. If it determines you want static, it will then look for the ip, the network, and broadcast addresses (and any other specifiable bits of information) before executing the above commands.
 
  


Reply

Tags
configuration, eth0, ifconfig, ifdown, ifup, ip, link, network


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
ifup and dhcp problems with trendnet NIC in Kubuntu medic007 Linux - Networking 2 08-03-2007 01:29 AM
Activating second NIC makes server lower saavik Linux - Networking 2 09-15-2004 09:37 AM
where is my ifup/down? syreth Slackware 4 09-13-2004 08:06 AM
Activating intergrated NIC mindseye Linux - Newbie 1 10-13-2003 04:54 AM
activating NIC without an error! pentiumoo2 Linux - Networking 9 10-22-2002 11:55 PM


All times are GMT -5. The time now is 11:37 PM.

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