LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 03-08-2008, 07:41 AM   #1
jsmith6
Member
 
Registered: Feb 2006
Distribution: Slackware 13.1 / 13.37
Posts: 91

Rep: Reputation: 16
rc.inet1 doesn't give me a new DHCP IP


I have two DSL routers. Each one gives me a different DHCP IP.

When I switch between the two routers I need to get a new IP, so I try to run:

Code:
/etc/rc.d/rc.inet1 restart
or:

Code:
/etc/rc.d/rc.inet1 stop
/etc/rc.d/rc.inet1 start
but nothing happens. If I change the router then I have to restart the computer to get a new IP.

Is there a way to re-new my IP without restarting?
 
Old 03-08-2008, 08:24 AM   #2
slackbat
Member
 
Registered: Dec 2005
Distribution: Slackware 14.2_64_multilib - freebsd - devuan
Posts: 85

Rep: Reputation: 23
Have you tried to alter /etc/resolv.conf?

You may need to enter something like

search lan
nameserver <whatever the gateway is for the router. this generally is set to the ip address of the router - or what you type into the browser window to contact the router. in my case 10.0.0.138 or 192.168.0.1 depending on which router I am using.>

You can have two nameserver ip's here ir you are using two routers at the same time.

then run /etc/rc.d/rc.inet1 restart to see what happens.

good luck.
 
Old 03-08-2008, 10:22 AM   #3
agentc0re
Member
 
Registered: Apr 2007
Location: SLC, UTAH
Distribution: Slackware
Posts: 200

Rep: Reputation: 34
you have to remove your /etc/dhcpc/dhcpcd-eth0.pid
or equivalent.
 
Old 03-10-2008, 05:38 PM   #4
jsmith6
Member
 
Registered: Feb 2006
Distribution: Slackware 13.1 / 13.37
Posts: 91

Original Poster
Rep: Reputation: 16
I managed to do it. Each time I swap the routers, I just have to:

Code:
/etc/rc.d/rc.inet1 stop
then:

Code:
ifconfig eth0 down
and then:

Code:
/etc/rc.d/rc.inet1 start
And it works!

Before that, I tried adding "search lan" on /etc/resolv.conf but it didn't worked. I tried removing the .pid but it still didn't worked. Something felt wrong.

I sat down and examined how I have connected all the cables and then I remembered that I have added a switch: router -> switch -> pc. I removed the switch and it still didn't worked.

At that point, I noticed that I can have one one swap between the two routers: from router 1 -> 2 *or* 2 -> 1. I couldn't make a second switch. Then I noticed that even if stoped rc.inet1, ifconfig still showed that eth0 was up.

That's when it hit me!

Thank you guys! I wouldn't have ended there if I was alone.

slackbat, there is something that you said that made me interested to learn more. I only have one Ethernet card and a switch, can I have applications use the first or the second router? Or perhaps type a command to swap between the two routers instead of plugging in and out of Ethernet cables? That would be cool! If not, I will consider buying a second Ethernet card to achieve this. Just point me to a document or some keyword to google.
 
  


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
suse 10.1 DHCP client via cable modem does not give a IP address... jojolx Linux - Hardware 11 12-09-2006 05:04 AM
rc.inet1 and a DHCP address ve1drg Slackware - Installation 2 11-11-2006 06:19 PM
Debian as home router; dhcp doesnt give out ips Tangshan Linux - Networking 2 08-01-2006 12:52 AM
Lynksys router, no DHCP. Have to use IP manualy, some one give me low down. RHLinuxGUY Linux - Networking 1 07-08-2004 03:16 AM
DHCP doesn't give the ip daznis Linux - Networking 2 04-17-2003 05:09 PM

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

All times are GMT -5. The time now is 06:04 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
Open Source Consulting | Domain Registration