Re: IP up

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Jay Jacobson
Date:  
To: plug
Subject: Re: IP up
On Tue, 27 Jul 2004, ec wrote:

> Being 'man page' stupid, how does one 'turn on' eth0
> from the command line? Do you have to be root?



By "turn on," do you mean actually turn on the network card hardware? If
so, you need to either compile the Ethernet card driver into your kernel
or load the proper module. Do you see your eth<n> interface if you do an
'ifconfig -a'? How about an 'lsmod'? If not, you will need to load the
module - see the 'modprobe' man page.

If you do have the module loaded and the hardware is recognized by the
system, then you probably mean that you just want to bring up an IP
address on the interface. If your network is using DHCP, this should
happen automatically. If it does not, you may need to restart your DCHP
client daemon. How to do this will be dependent on your distribution, but
likely something like '/etc/init.d/<SOMETHING> start' would do the
trick (where <SOMETHING> might be 'dhcpcd', 'dhclient', or various other
things - again, varies based on your distribution or configuration).

If you are not using DHCP, then it is very simple. Just use 'ifconfig' to
bring up the interface and 'route' to add the default gateway. Their
associated man pages are pretty clear. The basic syntax would be (assuming
your IP is 10.0.0.2 and your gateway is 10.0.0.1):

ifconfig eth0 10.0.0.2 netmask 255.255.255.0
route add default gw 10.0.0.1

~Jay

--
..
.. Jay Jacobson
.. Edgeos, Inc. - 480.961.5996 - http://www.edgeos.com
..
.. Network Security Auditing and
.. Vulnerability Assessment Managed Services
..

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss