LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-15-2005, 05:41 AM   #1
dannyk1
Member
 
Registered: Aug 2004
Location: Geelong, Vic Australia
Distribution: Gentoo, Ubuntu,and sometimes something from billy gates (when Im desperate)
Posts: 188

Rep: Reputation: 31
getting eth0 up from command line


My interface eth0 is connect to a dsl modem which works fine but...

How do I get eth0 to request a new dhcp address from the command line?

I have been trying things like

ifconfig eth0
ifconfig eth0 up
ifconfig eth0 up dhcp
with no luck.

Restarting the computer seems to defeat the purpose of using linux..

The reason for this is everynow and then the power drops off my modem then the only way to get everything working again is to restart the computer.
 
Old 12-15-2005, 05:47 AM   #2
abakali
Member
 
Registered: Dec 2005
Location: karachi
Distribution: RedHat
Posts: 75

Rep: Reputation: 15
ifdown eth0
ifup eth0
must select bootp option for renewing new ip
 
Old 12-15-2005, 05:50 AM   #3
Notwerk
Member
 
Registered: Apr 2005
Location: Jordan
Distribution: Debian (Sarge), Ubuntu (6.06)
Posts: 271

Rep: Reputation: 31
You can try

#ifup eth0

personally i prefer to restart all networking services with

# /etc/init.d/network restart

Hope this helps
 
Old 12-15-2005, 06:18 AM   #4
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
# dhcpcd eth0
 
Old 12-15-2005, 08:19 AM   #5
sjtushi
LQ Newbie
 
Registered: Dec 2005
Posts: 4

Rep: Reputation: 0
first check #ifconfig eth0
#ifup eth0
 
Old 12-21-2005, 02:35 AM   #6
dannyk1
Member
 
Registered: Aug 2004
Location: Geelong, Vic Australia
Distribution: Gentoo, Ubuntu,and sometimes something from billy gates (when Im desperate)
Posts: 188

Original Poster
Rep: Reputation: 31
Thanks guys for the replys.

/etc/init.d/network restart

seems to do the trick.

/etc/init.d/iptables restart helps too.
 
Old 12-21-2005, 04:16 AM   #7
Notwerk
Member
 
Registered: Apr 2005
Location: Jordan
Distribution: Debian (Sarge), Ubuntu (6.06)
Posts: 271

Rep: Reputation: 31
BTW...

IFF your eth0 is connected to a "Bridged" DSL modem AND you're using pppoe then you might want to look into:
/etc/sysconfig/network-scripts/ifcfg-%ppp0%
(substitute %ppp0% with your connection name)

setting "PERSIST=yes" (without the quotes) will have the machine re-establish the connection when it's dropped. The down-side is that the machine will keep trying until it gets a connection.
 
  


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
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 07:19 PM
Who to configure eth0 to use dhco from command line waelaltaqi Linux - Networking 3 11-18-2005 06:36 PM
Redirecting output to a command-line argument of another command madiyaan Linux - Newbie 1 02-19-2005 04:35 PM
Command to output file content line by line aznluvsmc Programming 2 09-12-2004 07:45 PM
51 characters only in the 1st Line of command line eggCover Linux - General 2 07-29-2004 01:28 PM

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

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

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