Find the answer to your Linux question:
Results 1 to 9 of 9
I connect to the internet via a network (a WinXP machine connects to the net which is shared via ICS), and DHCP normally assigns an IP adress as it should, ...
  1. #1
    Just Joined!
    Join Date
    Mar 2005
    Location
    South Africa
    Posts
    55

    How to get DHCP to assign IP address

    I connect to the internet via a network (a WinXP machine connects to the net which is shared via ICS), and DHCP normally assigns an IP adress as it should, but every now and then an address is not assigned (on bootup) . Only way to access the net is to disable ICS on the XP machine and then re-enable it, and will then assign an IP address as it should, but I then re-boot my Linux machine for DHCP to operate as it should.

    Any way of starting DHCP manually with Linux from a console, preventing the reboot ?

    Thanks.

  2. #2
    Just Joined!
    Join Date
    Feb 2005
    Posts
    21
    I believe that you can create a script which will manually start DHCP, or you have the option of adding DHCP, I think, to your init -- which will automatically load DHCP on boot.

  3. #3
    Linux Engineer psic's Avatar
    Join Date
    Nov 2004
    Location
    Ljubljana, Slovenia
    Posts
    1,205

    Re: How to get DHCP to assign IP address

    Quote Originally Posted by infoseeker
    Any way of starting DHCP manually with Linux from a console, preventing the reboot ?

    Thanks.
    I used 'dhclient' for a while. There's others, such as 'dhcpcd'. Try it out if any of these work (you will have to be root).
    Stumbling around the 'net:
    www.cloudyuseful.com

  4. #4
    Just Joined!
    Join Date
    Mar 2005
    Location
    South Africa
    Posts
    55
    The 'dhclient' command seems to be the one to use :P . I will try using it when I have this problem next time, and will post if successful.

    Just tried it with a valid IP address/connection and it successfully changed the assigned address to a new one.

    Thanks.

  5. #5
    Linux Engineer psic's Avatar
    Join Date
    Nov 2004
    Location
    Ljubljana, Slovenia
    Posts
    1,205
    Not a problem. I used it often on a laptop, which wasn't always connected (so whenever it was, I just ran it by hand so it got a valid IP).
    Stumbling around the 'net:
    www.cloudyuseful.com

  6. #6
    Linux User
    Join Date
    Apr 2005
    Location
    Ohio
    Posts
    326
    IF I need my Debian box to get a new Address from dhcp I simply shut down the interface and bring it back up..

    ifdown eth0
    ifup eth0

    once it comes up it grabs a new IP..

  7. #7
    Just Joined!
    Join Date
    Mar 2005
    Location
    South Africa
    Posts
    55

    Re: How to get DHCP to assign IP address

    I have just had this problem again on bootup (see post above) and i entered 'dhclient' in root console and IT WORKS .

    Thanks for the help.

  8. #8
    Linux Guru Vergil83's Avatar
    Join Date
    Mar 2004
    Posts
    2,408
    you can make it happen automatically by using the init scripts
    it will be at
    Code:
     /etc/inti.d/dhcpd
    additionally, dhcp can be started/stopped by running
    Code:
    /etc/inti.d/dhcpd start
    /etc/inti.d/dhcpd stop
    Brilliant Mediocrity - Making Failure Look Good

  9. #9
    Just Joined!
    Join Date
    May 2008
    Posts
    1

    Unhappy how does a dhcp gets assigned

    I want to know more about... how using dhcp... an ip address gets bound to a network interface as i am debugging an issue (I am not a pro at linux just a new user trying switch over from windows).

    If you want to know... the issue it is this...

    I am on a windowsxp machine (on a wireless network:192.168.1.*) and have VirtualBox image with ubuntu running on it (server edition)... the linux on VM get it's ip using dhcp configured in /etc/network/interfaces for eth0... it is in the range 10.0.*.*

    now i changed from dhcp to static and i supplied the static ip address... 192.168.1.12 and the gateway as our wireless router 192.168.1.1 and nameserver in /etc/resolv.conf as 192.168.1.1 (this being an adsl modem also).... I am not able to ping anywhere from ubuntu.... and ubuntu from anywhere...

    but one thing that i have noticed is that when i use a wget Google it get the file....

    I am all confused as to what i going around with this setup...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •