Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Rep:
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.....)
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Rep:
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.