LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 12-01-2006, 06:22 AM   #1
Exio
Member
 
Registered: Dec 2003
Location: Heath and reach
Distribution: Slackware
Posts: 54

Rep: Reputation: 15
Unhappy Simple - Changing your network settings without rebooting???


Hi,

I just started using Linux again. Its been a year and iv forgotten almost everything..

I remembered "netconfig" WOO but I have to reboot my box every time i make a change in it.

How do i get it to change with out rebooting.

P.S - I remembered "ifconfig" to WAHHOOO Iím a Linux Guru

Thanks

Nick (Linux Guru )
 
Old 12-01-2006, 06:33 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
You shouldn't need to reboot after using netconfig; what you probably have to do is bring the interface(s) down and up (that's what happens during reboot anyway) when you make changes. Probably either one of these (I don't do much changes to my network settings, and I'm working on a non-Linux box atm, so just guessing):
Code:
ifconfg eth0 down
ifdown eth0
and then configure the settings you like and do either one of these:
Code:
ifconfig eth0 up
ifup eth0
That should work.

EDIT: you could also use ifconfig to change ip address etc. like
Code:
ifconfig eth0 down
ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up
 
Old 12-01-2006, 06:37 AM   #3
Exio
Member
 
Registered: Dec 2003
Location: Heath and reach
Distribution: Slackware
Posts: 54

Original Poster
Rep: Reputation: 15
I shall give this a go!! Thanks for the speedy Reply!

Nick
 
Old 12-01-2006, 06:55 AM   #4
Exio
Member
 
Registered: Dec 2003
Location: Heath and reach
Distribution: Slackware
Posts: 54

Original Poster
Rep: Reputation: 15
Just had a thought!!!

Im connecting using putty.

If i take my etho down this will disconect me?

I remember $$ command?

can i do

ifconfig eth0 down $$ ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up

then re-putty back in??

Nick
 
Old 12-01-2006, 07:22 AM   #5
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
If eth0 is the interface over which your putty traffic is travelling, taking down that connecting will prevent further communication with the machine.

I think you mean &&, not $$. $$ means "the PID of the current shell". left && right means "if left returned no error, execute right.

In this case it might be better to separate the commands with ; which means all commands will be executed regardless of the success of the previous command. I've thrown a sleep in there too. I don't know if it's necessary, but it might help make it a little more robust - some interfaces like to be left alone for a few seconds before you brind them back up.
Code:
ifconfig eth0 down ; sleep 2 ; ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up
 
Old 12-01-2006, 07:24 AM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
One more thing. Bringing down the putty session might stop the commands after "ifconfig eth0 down" from running. Consider running it all inside a screen session.
 
Old 12-01-2006, 11:36 AM   #7
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,240
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
if you edit the network config manually I would think you could also use

/etc/init.d/networking restart
 
Old 12-01-2006, 11:53 AM   #8
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
ip addr add 172.16.16.19/22 dev eth0 broadcast 172.16.19.255
 
Old 12-01-2006, 03:39 PM   #9
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,240
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
Quote:
Originally Posted by amitsharma_26
ip addr add 172.16.16.19/22 dev eth0 broadcast 172.16.19.255

Is this response for this thread or was it supposed to be for something else ?

A little explanation along with the response would be helpful..
 
Old 12-02-2006, 10:45 AM   #10
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Quote:
Originally Posted by amitsharma_26
ip addr add 172.16.16.19/22 dev eth0 broadcast 172.16.19.255
That was pretty self explainable.

ip address add <ip>/<mask> dev <dev-name> broadcast <broadcast-ip(is required moreoften when you have not mentioned a mask)>


There are many other options availbale with ip add command, ip addr help would be more supportive for the rest.
 
Old 12-02-2006, 12:14 PM   #11
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,240
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
Code:
debian:~# ip addr add 172.16.16.19/22 dev eth0 broadcast 172.16.19.255
-su: ip: command not found
is that distro specific or part of a particular tool that needs to be installed ?
That's the reason I asked, because it doesn't seem to work..


A bit of searching finally turned up the answer..
in ordert to use ip addr add you must have the iproute package installed.

Quote:
debian:~# apt-cache search iproute
iproute - Professional tools to control the networking in Linux kernels
iproute-dev - Development package for iproute
iproute-doc - Professional tools to control the networking in Linux kernels
libabz0 - Miscellaneous useful routines

debian:~# apt-cache policy iproute
iproute:
Installed: (none)
Candidate: 20061002-2
Version table:
20061002-2 0
500 ftp://mirrors.kernel.org sid/main Packages

debian:~# apt-get install iproute
.
.
debian:~# ip addr help

Usage: ip addr {add|del} IFADDR dev STRING
ip addr {show|flush} [ dev STRING ] [ scope SCOPE-ID ]
[ to PREFIX ] [ FLAG-LIST ] [ label PATTERN ]
that's whay I was so confused by your response... It didn't work for me, because it requires another package to be installed that isn't installed by default, and the package name required was never mentioned.. I get it now..
 
  


Reply


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
Changing without rebooting coolb Linux - General 3 07-14-2006 11:12 AM
Changing Network Settings ComputerErik Slackware 1 08-06-2005 01:21 AM
Changing DHCP Network Settings dhammika Linux - Networking 3 03-16-2004 09:36 PM
Randomly changing network settings with pcmcia rhubarb Linux - Newbie 0 01-31-2003 10:02 AM
Changing US keyboard settings to Spain (SP) settings or Mexico. zLinuxz Linux - General 4 12-01-2002 01:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration