Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-17-2008, 05:41 PM   #1
Registered: Oct 2007
Posts: 162

Rep: Reputation: 30
commands to assign IP

Hai all,

I have 2 ethernet adapters in my Linux RHEL ES 4 box.. how can I allocate all IP settings (IP,Gateway,DNS ) using commands and activate that ethernet..

Old 06-17-2008, 06:17 PM   #2
Registered: Jun 2007
Distribution: Gentoo
Posts: 172

Rep: Reputation: 30
I'll assume that the two adapters are eth0 and eth1. Replace words prefixed with $
With static IP:
ifconfig eth$n $ip # set ip adress
ifconfig eth$n netmask $nmask # probably
route add default $gateway # set up gateway through your gateway (probably a router or modem)
ifconfig eth$n up # activate
With DHCP:
dhclient # it should check both interfaces and activate them automatically


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 to assign domain to IP? TefoZi Linux - Newbie 6 04-30-2008 11:43 PM
how to assign a host name? Mountain Linux - Newbie 9 11-07-2007 06:07 PM
assign commands to Variables tazbv Programming 2 08-03-2007 03:07 AM
How To Assign Static Ip? betrussell23 Linux - Networking 5 09-27-2006 02:25 AM
Suse Linux Commands For These Aix Commands? Vaskar Guha Linux - Software 2 12-19-2005 01:45 AM > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration