This is a discussion on OT: What is command to get IP from router? within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> Al C. wrote: > OK, how do I get the darn thing back up again? re-run rc.d/init1? Or can ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Al C. wrote: > OK, how do I get the darn thing back up again? re-run rc.d/init1? Or can I > just execute it from the command line without an arguement? I do it from the command line, with the line from /etc/rc.d/rc.inet1. I don't see why you'd need to run the whole script again. Have Fun! Rich |
| |||
| Al C. wrote: > If you take down the eth0 via ifconfig (ifconfig eth0 -down) , would that > have any effect on obtaining a new IP when you brought it back "up" again? > I kind of doubt it but you would know better than I. In order to get your interface going again with the new IP, run /etc/rc.d/rc.inet1 eth0_start. Instead of *just* hupping dhcpcd, you can run "/etc/rc.d/rc.inet1 eth0_restart" which will do perform both steps at once. Jeffrey |
| |||
| Once upon a time, Jeffrey Froman <Jeffrey@Fro.man> said: >Al C. wrote: >> If you take down the eth0 via ifconfig (ifconfig eth0 -down) , would that >> have any effect on obtaining a new IP when you brought it back "up" again? >> I kind of doubt it but you would know better than I. Depends on how dhcp is configured, but it shouldn't. It doesn't, the way Slackware 9.1 is configured by default (dunno about 10.0, I do not use dot-zero versions of software). "dhcpcd -t 10 -d eth0" will probably work fine for you. (It does for me.) -- TTK |
| |||
| standardblue wrote: > On Thu, 26 Aug 2004 18:43:34 +0000, micke wrote: > >> Al C. wrote: >> >>> This is an academic exercise only, so ignore if busy. >>>Snip >>>>> >>> believe there is some Linux command that will cause the router to >>> 'release' my IP and give me a new one and avoid a re-boot. Does anyone >>> know such a command? >>> Snip >>>>>> >>> Thanks, >>> Al >> >> Read in the /etc/rc.d/rc.inet1 how to do it. There is a section about how >> to take down an interface and how to bring it up again. >> Micke > > The daemon that takes care of obtaining IP addresses (and therefore > releasing them as well?) is the dhcpcd. (DHCP client daemon). Take a look > for that in rc.inet1 perhaps. > > HTH, > > sb > It's in there to. Look at the following: if grep eth${1}: /proc/net/dev 1> /dev/null ; then # interface exists if ! /sbin/ifconfig | grep "eth${1} " 1> /dev/null ; then # interface not up if [ "${USE_DHCP[$1]}" = "yes" ]; then # use DHCP to bring interface \ up # Read the line above. if [ ! "${DHCP_HOSTNAME[$1]}" = "" ]; then /sbin/dhcpcd -t 10 -h ${DHCP_HOSTNAME[$1]} -d eth${1} else /sbin/dhcpcd -t 10 -d eth${1} fi Those lines check if the interface is up and if it is then assign the IP from a DHCP. Read the whole /etc/rc.d/rc.inet1 and you will see, and if that is not enough then read the man pages for ifconfig and then for dhcpd and so on. It wont take that long time to read them. : ) Micke -- # The truth lies in there, # # somewhere in the manual. # |
| |||
| no wrote: > standardblue wrote: > >> On Thu, 26 Aug 2004 18:43:34 +0000, micke wrote: >> >>> Al C. wrote: >>> >>>> This is an academic exercise only, so ignore if busy. >>>>Snip >>>>> >>>> believe there is some Linux command that will cause the router to >>>> 'release' my IP and give me a new one and avoid a re-boot. Does anyone >>>> know such a command? >>>> Snip >>>>>> >>>> Thanks, >>>> Al >>> >>> Read in the /etc/rc.d/rc.inet1 how to do it. There is a section about how >>> to take down an interface and how to bring it up again. >>> Micke >> >> The daemon that takes care of obtaining IP addresses (and therefore >> releasing them as well?) is the dhcpcd. (DHCP client daemon). Take a look >> for that in rc.inet1 perhaps. >> >> HTH, >> >> sb >> > > It's in there to. > Look at the following: > if grep eth${1}: /proc/net/dev 1> /dev/null ; then # interface exists > if ! /sbin/ifconfig | grep "eth${1} " 1> /dev/null ; then # interface > not up > if [ "${USE_DHCP[$1]}" = "yes" ]; then # use DHCP to bring interface \ > up > # Read the line above. > if [ ! "${DHCP_HOSTNAME[$1]}" = "" ]; then > /sbin/dhcpcd -t 10 -h ${DHCP_HOSTNAME[$1]} -d eth${1} > else > /sbin/dhcpcd -t 10 -d eth${1} > fi > > Those lines check if the interface is up and if it is then assign the IP > from a DHCP. > Read the whole /etc/rc.d/rc.inet1 and you will see, and if that is not > enough then read the man pages for ifconfig and then for dhcpd and so on. > It wont take that long time to read them. : ) > > Micke > Yeah, thanks. I see what I have to do now. Not hard at all. I'm surprised there is not a KDE interface to getting a new IP from the router (via root). Seems that every version of KDE comes with more and more 'root based' system admin 'features.' Yeah, I know some of them don't work and that 'true Slackers' don't use them, but for others of us who are only 'semi-true' Slackers, they are 'convenient.' Thanks again. ANC |
| |||
| Al C. wrote: > SNIP >>>>>>>>>>> > Yeah, thanks. I see what I have to do now. Not hard at all. > > I'm surprised there is not a KDE interface to getting a new IP from the > router (via root). Seems that every version of KDE comes with more and > more 'root based' system admin 'features.' Yeah, I know some of them don't > work and that 'true Slackers' don't use them, but for others of us who are > only 'semi-true' Slackers, they are 'convenient.' > SNIP >>>>>>>>>>> No not hard at all! : ) Well if you know what to do then it's easy, if not then it's sometimes hard to figure out. Don't know any KDE tool for this or for that matters anything else, perhaps there is but I've never looked for it. Rather new at using GUI at all : ) Perhaps in other distros?? I don't know. Long time since I've used anything else. Micke -- # The truth lies in there, # # somewhere in the manual. # |
| |||
| no wrote: > Al C. wrote: >> SNIP >>>>>>>>>>> >> Yeah, thanks. I see what I have to do now. Not hard at all. >> >> I'm surprised there is not a KDE interface to getting a new IP from the >> router (via root). Seems that every version of KDE comes with more and >> more 'root based' system admin 'features.' Yeah, I know some of them >> don't work and that 'true Slackers' don't use them, but for others of us >> who are only 'semi-true' Slackers, they are 'convenient.' >> SNIP >>>>>>>>>>> > > No not hard at all! : ) > Well if you know what to do then it's easy, if not then it's sometimes > hard to figure out. > > Don't know any KDE tool for this or for that matters anything else, > perhaps there is but I've never looked for it. Rather new at using GUI at > all : ) Perhaps in other distros?? I don't know. Long time since I've used > anything else. > Micke > Once you get the system set up and configured, there's normally no need to get a new DHCP address by hand, and the few times that you do, it's probably not worth writing a GUI for - it's only one line, after all. Cheers! Rich |
| ||||
| try ipconfig eth0 up that works for me. Paul Rich Grise wrote: > Al C. wrote: > > >>OK, how do I get the darn thing back up again? re-run rc.d/init1? Or can I >>just execute it from the command line without an arguement? > > > I do it from the command line, with the line from /etc/rc.d/rc.inet1. > I don't see why you'd need to run the whole script again. > > Have Fun! > Rich > |