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 04-06-2006, 05:23 AM   #1
twallstr
LQ Newbie
 
Registered: Aug 2004
Posts: 25

Rep: Reputation: 15
ifconfig up does not work


I am using a laptop mostly offline. Sometimes, after startup, I wish to connect to the network/Internet. After plugging in the network cable I issue the command ifconfig eth0 up, with no error message appearing. The command ifconfig seemingly shows that the interface is up and running. This is not the case though.
The only way then to access the network is to reboot my computer.
On my distribution, Xandrows, I have a button to connect/disconnect the network and it works fine, but I want to be able to do this from the command line.

Can anybody tell me what I have done wrong?

Thanks!

twallstr
 
Old 04-06-2006, 05:45 AM   #2
andygo
Member
 
Registered: May 2005
Location: Ukraine, Kiev
Distribution: SLES, Raspbian, Ubuntu-Mate, LineageOS
Posts: 114

Rep: Reputation: 15
how does your interface configured? (DHCP or static IP)
what error message ifconfig shows?
how do you connected to the NET?


PS definetly, rebooting your mashine is not nessesery
 
Old 04-06-2006, 05:46 AM   #3
Slick666
Member
 
Registered: Feb 2006
Distribution: Ubuntu 8.04; Debian Etch
Posts: 167

Rep: Reputation: 33
After Connecting the cable try using the command "dhcpcd". I usually don't have to give any arguments.

Let me know if that works out for you
 
Old 04-06-2006, 05:54 AM   #4
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Cool

Quote:
Originally Posted by twallstr
I am using a laptop mostly offline. Sometimes, after startup, I wish to connect to the network/Internet. After plugging in the network cable I issue the command ifconfig eth0 up, with no error message appearing. The command ifconfig seemingly shows that the interface is up and running. This is not the case though.
The only way then to access the network is to reboot my computer.
On my distribution, Xandrows, I have a button to connect/disconnect the network and it works fine, but I want to be able to do this from the command line.

Can anybody tell me what I have done wrong?

Thanks!

twallstr
You say you have a button and it works fine, so why are you rebooting?

From what you have described, the ifconfig command is working normally. It can bring up an interface, but that is not the same as establishing as connection through it- those are two separate things.

As the other guys said/asked, we need to know how you are connecting. If you are using DHCP, you can do this as root, and it will establish a connection for you (if you have the dhcpcd client. If not, find out what client you have, they all have similar arguments.....)

Code:
dhcpcd -d -t 10 eth0

Last edited by Randux; 04-06-2006 at 05:59 AM.
 
Old 04-06-2006, 05:57 AM   #5
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Quote:
Originally Posted by andygo
PS definetly, rebooting your mashine is not nessesery
Absolutely correct. This isn't *doze!

The reason the network starts after a boot is that the startup script that brings up your network runs. You could run that any time, if you knew what it was. But I suspect, as everyone else, that it's just DCHP client needing to be started.
 
Old 04-06-2006, 06:57 AM   #6
twallstr
LQ Newbie
 
Registered: Aug 2004
Posts: 25

Original Poster
Rep: Reputation: 15
I am using a static IP address, and I do NOT get an error message when using the ifconfig command.
I connect to the Internet via cable access, and all commands are performed as root.
As I said before my Xandrows network button works nicely to bring up the connection (or kill it) but I am just curious how to do it through the command line.

Thanks!

twallstr
 
Old 04-06-2006, 07:35 AM   #7
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Quote:
Originally Posted by twallstr
I am using a static IP address, and I do NOT get an error message when using the ifconfig command.
I connect to the Internet via cable access, and all commands are performed as root.
As I said before my Xandrows network button works nicely to bring up the connection (or kill it) but I am just curious how to do it through the command line.

Thanks!

twallstr
Hi,

I don't use Xandrows. You should be able restart the network using the init that is run during the boot.

Basically you could just use;

Code:
#ifconfig eth0 192.168.0.4          #set to your IP
#route add default gw 192.168.0.1   #set to your gateway
Your system should now work.

In Slack we just;

Code:
#/etc/rc.d/rc.inet1 restart
This will use the configuration file /etc/rc.d/rc.inet1.conf that has the network information. I'm sure you have the same means to init the network. I'm not sure about your tree configuration. Check your /etc to find the startup scripts.
 
  


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
ifconfig doesn't work ccerino Fedora 9 08-04-2009 10:53 PM
Ifconfig does noet work :( turalo Linux - Networking 18 12-17-2005 08:06 AM
ifconfig doesn't work woodland56 Linux - Newbie 7 03-09-2005 01:34 PM
My commands dont work. ifconfig ? slice4e Linux - General 5 05-08-2003 11:51 PM
ifconfig won't work Hollywood W Linux - Newbie 9 04-17-2003 04:07 AM

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

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