LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-20-2010, 10:16 PM   #1
rigelan
Member
 
Registered: Jul 2005
Location: Iowa
Distribution: Slackware
Posts: 180

Rep: Reputation: 19
changing ip address on the fly in slackware


If I need to adjust my network settings (rc.inet1.conf) on the fly, like if I need to be in the local network of a router I just bought (192.168.1.x), in order to change the subnet to the rest of my network (192.168.0.x), then I need to adjust the ip address of my slackware box.

Up till now I have rewritten the rc.inet.conf file and then restarted the computer. I am almost positive that restarting is unneccesary, but I have not been successful in finding any other method.

Maybe I am using the tool wrong, but I have tried using wicd to disconnect and then connect again once I change the rc.inet1.conf. I don't think it worked.

I think I have also tried issuing a rc.inet1 restart. But I don't think that this changed my ip address either. How do you change your ip address on the quick without restarting your box?
 
Old 08-20-2010, 10:37 PM   #2
the3dfxdude
Member
 
Registered: May 2007
Posts: 734

Rep: Reputation: 358Reputation: 358Reputation: 358Reputation: 358
As root:
# ifconfig eth0 192.168.0.x

Replace eth0 and x with your own. I don't know if this interferes with wicd.

Last edited by the3dfxdude; 08-20-2010 at 11:12 PM.
 
Old 08-21-2010, 12:00 AM   #3
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
simply executing /etc/rc.d/rc.inet1 should restart the network and use the changes you made to rc.inet1.conf

so you definitely shouldn't have to reboot...

If you don't even want to mess with the text files (i.e., don't need change to be permanent), then you can just use ifconfig to assign an ip to an interface
Code:
ifconfig eth0 inet 192.168.1.2 netmask 255.255.255.0
 
Old 08-21-2010, 07:07 AM   #4
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
Hi,

Actually;

Code:
ifconfig eth0 192.168.1.2
The above IP assignment would be all that is necessary unless you need to change the netmask.

Be aware that to change the IP may cause problems with any of the other machines that where set to the previous machine IP assignment.
 
Old 08-21-2010, 10:37 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by slac-in-the-box View Post
simply executing /etc/rc.d/rc.inet1 should restart the network and use the changes you made to rc.inet1.conf
AIUI the default action of the rc.inet1 script is to start rather than restart (stop followed by start).

The rc.inet1 script can stop and start (but not restart) an individual interface, for example
Code:
/etc/rc.d/rc.inet1 eth0_stop
/etc/rc.d/rc.inet1 eth0_start
IDK under what conditions an interface should be stopped before being started with a new configuration -- so it seems prudent to do it in all cases in case it matters.

Last edited by catkin; 08-21-2010 at 10:38 AM.
 
Old 08-21-2010, 10:42 AM   #6
rigelan
Member
 
Registered: Jul 2005
Location: Iowa
Distribution: Slackware
Posts: 180

Original Poster
Rep: Reputation: 19
Code:
/etc/rc.d/rc.inet1 eth0_stop
/etc/rc.d/rc.inet1 eth0_start
You have to specify the interface when using rc.inet1 ?
 
Old 08-21-2010, 01:11 PM   #7
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
The allowed arguments to rc.inet1 are start,stop,restart,up,down which act on all interfaces or INT_start, INT_stop, INT_restart, INT_up, INT_down where INT is the name of an interface to start which is the same as "up", stop - the same as "down" or restart.

rc.inet1 now has it's own man page so man rc.inet1 will give you the information.

Last edited by bgeddy; 08-21-2010 at 01:32 PM.
 
Old 08-21-2010, 01:19 PM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by bgeddy View Post
The allowed arguments to rc.inet are start,stop,restart,up,down which act on all interfaces or INT_start, INT_stop, INT_restart, INT_up, INT_down where INT is the name of an interface to start which is the same as "up", stop - the same as "down" or restart.
That is correct; I was wrong about it not supporting the INT_restart argument.
 
  


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
Changing MAC address on the Fly shaiss Linux - Kernel 1 04-15-2010 02:35 PM
Changing resolution on the fly _wb_ Linux - Newbie 6 07-09-2003 11:11 PM
Changing Fb settings on the fly raypen Slackware 0 03-24-2003 10:01 AM
Changing Kernel on the fly NSKL Linux - General 1 06-07-2002 05:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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