Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dhcpcd question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
togge
n00b
n00b


Joined: 17 Mar 2003
Posts: 14

PostPosted: Wed Jun 04, 2003 6:57 am    Post subject: dhcpcd question Reply with quote

I have been useing slackware for over 3 years at home and at work
After i installed gentoo i noticed that my dhcpserver at home and at work give me different ip for each time i boot my computer.
I dont know why this happends, and its realy annoying..

When slackware boots it says something like:
dhcpcp: Askering for address xxx.xxx.xxx.xxx

The wierd thing is that my ip at work havent changed one time sience i started working here, and now i changes every time i boot...

Anyone know why this happends ?
It doesnt have anything to do with the dhcp server, cause everyone else at work gets the same ip each time...
But then again... am the only one who uses gentoo at work
Back to top
View user's profile Send private message
Ethernal
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2002
Posts: 106
Location: Stockholm, Sweden

PostPosted: Wed Jun 04, 2003 8:03 am    Post subject: Reply with quote

That's actually quite wierd since the DHCP server should remember your MAC and give you your old IP back. And since you don't actually release your IP there's defenitly no reason. Maybe Gentoo asks for the previous IP again.

Sorry, I'm no big help. I always use fixed IP.. :(
_________________
Hmm.. Of course, these are MY opinions - likely to be just as flawed as anyone else's. Um, really, I guess you should assume everyone's speaking out of some external influence. Believe in whatever makes sense to you.
Back to top
View user's profile Send private message
togge
n00b
n00b


Joined: 17 Mar 2003
Posts: 14

PostPosted: Wed Jun 04, 2003 9:38 am    Post subject: Reply with quote

When i run dhcpcd -d eth0 and look in the syslog you can see that it asks for the old ip...
Could there be any screw up there ?

Jun 4 12:46:22 togge dhcpcd[779]: broadcasting DHCP_DISCOVER
Jun 4 12:46:22 togge dhcpcd[779]: broadcastAddr option is missing in DHCP server response. Assuming 172.17.255.255
Jun 4 12:46:22 togge dhcpcd[779]: dhcpIPaddrLeaseTime=1814400 in DHCP server response.
Jun 4 12:46:22 togge dhcpcd[779]: DHCP_OFFER received from (172.17.0.2)
Jun 4 12:46:22 togge dhcpcd[779]: broadcasting DHCP_REQUEST for 172.17.7.43
Jun 4 12:46:22 togge dhcpcd[779]: dhcpIPaddrLeaseTime=1814400 in DHCP server response.
Jun 4 12:46:22 togge dhcpcd[779]: DHCP_ACK received from (172.17.0.2)
Back to top
View user's profile Send private message
iso
n00b
n00b


Joined: 06 Dec 2002
Posts: 6
Location: Sweden

PostPosted: Wed Jun 04, 2003 10:01 am    Post subject: dhcpcd question Reply with quote

This is probably related to a known problem with the net-scripts for Gentoo (if you haven't modified them already). A simple workaround is to modify your /eth/net.eth0 script (under the stop() function that relates to dhcp) to read like this:

Code:

        if [ "$(eval echo \$\{iface_${IFACE}\})" = "dhcp" ]
        then
                # Bug!
                #/sbin/dhcpcd -k ${IFACE} &>/dev/null
 
                # Suggested fix
                kill -SIGTERM `cat /var/run/dhcpcd-${IFACE}.pid` &>/dev/null
 
                # Give dhcpcd time to properly shutdown
                #local count=0
                #einfon "  Waiting for dhcpcd to shutdown"
                #while [ "${count}" -lt 5 ]
                #do
                #       echo -n "."
                #       sleep 1
                #       count=$((count + 1))
                #done
                #echo "done"
        else
                /sbin/ifconfig ${IFACE} down >/dev/null
        fi
        eend 0


All the lines commented out is part of the original script. It is the method shutting down dhcpcd with /sbin/dhcpcd -k ${IFACE} &>/dev/null that causes dhcpcd to release the IP address. If dhcpcd is signalled with SIGTERM instead the current IP address is kept in a cache-file. At the next boot dhcpcd requests the same address again (and probably will get it).

The section that gives dhcpcd time to shutdown may be neccessary, but I don't think so. Comment it out with caution if you like.

I hope someone responsible for the net.eth-scrips will fix this soon since it causes problems for new users. I installed gentoo last november and haven't had any problems at all with this modification.
Back to top
View user's profile Send private message
togge
n00b
n00b


Joined: 17 Mar 2003
Posts: 14

PostPosted: Wed Jun 04, 2003 11:13 am    Post subject: Reply with quote

I'll make the changes and see if i have the same ip tomorrow..

Thanks alot for you help :wink:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum