How to switch setup from fixed IP to receive dynamic IP from DHCP server (and vice versa)?

Discussion in 'Linux Networking' started by Matthew Lincoln, Jun 1, 2008.

  1. How can I detect if the current Linux system has an assigned, fixed, static IP
    or if it receives at bootup always a new dynamic IP from the in-house-LAN DHCP-server?

    How can I change the setup from static to dynamic IP assignment (Resp. the other way)?

    Matthew
     
    Matthew Lincoln, Jun 1, 2008
    #1
    1. Advertisements

  2. Matthew Lincoln

    Bit Twister Guest

    On 01 Jun 2008 06:39:26 GMT, Matthew Lincoln wrote:

    Based on all the provided information, you might consider reading
    http://www.catb.org/~esr/faqs/smart-questions.html
    Read nic's config files.
    Change nic's config file, restart interface.
     
    Bit Twister, Jun 1, 2008
    #2
    1. Advertisements

  3. It depends on your distribution. What is it?

    Robert
     
    Robert Harris, Jun 1, 2008
    #3
  4. ===check the network configuration file, that should be under /etc/
    sysconfig/network-scripts/ for rpm redhat based distro and ...
    under /etc/network/ for debian based distro
    === remove the static IP address info lines from teh file and then
    add the dhcp lines

    For ubuntu only add the line below.

    iface eth0 inet dhcp
     
    Shibu C Varughese, Jun 1, 2008
    #4
  5. Matthew Lincoln

    goarilla Guest

    pgrep -l dhc
    if this returns anything ... you're probably using
    a dynamic ip.
     
    goarilla, Jun 1, 2008
    #5
  6. Matthew Lincoln staggered into the Black Sun and said:
    One of "pgrep dhcpcd", "pgrep pump", or "pgrep dhclient" should return a
    PID if any of the major DHCP clients are running.
    Distro-dependent. Which distro are you using? Edit /etc/conf.d/net for
    Gentoo, /etc/sysconfig/network-scripts/ifcfg-ethN for Redhat-derived
    distros, and /etc/network/interfaces for Debian-derived distros.
     
    Dances With Crows, Jun 1, 2008
    #6
  7. Matthew Lincoln

    Bill Marcum Guest

    ["Followup-To:" header set to comp.unix.questions.]
    For a Debian-based system, edit /etc/network/interfaces or use the GUI.
    For an rpm-based system, look in /etc/sysconfig or use the GUI.
    For Slackware or others, I don't know, maybe look for "DHCP" in
    /var/log/syslog.
     
    Bill Marcum, Jun 1, 2008
    #7
  8. Matthew Lincoln

    Doug Laidlaw Guest

    There was a time when I always seemed to get the same IP address, but my ISP
    confirmed that it was dynamically assigned, i.e. simply chance. If I
    wanted a fixed IP address, I had to pay extra.

    Doug.
     
    Doug Laidlaw, Jun 4, 2008
    #8
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.