Results 1 to 7 of 7

Thread: NIC With Static IP Assigning Itself Dynamic IP

  1. #1
    Junior Member
    Join Date
    Jun 2001
    Location
    Melbourne, Australia
    Posts
    94

    NIC With Static IP Assigning Itself Dynamic IP

    Hi,

    My very recently built Debian Sarge box seems to be giving itself a dynamic IP from time to time. I'm using it as a webserver and a Squid proxy (although no-one is using it as a proxy just yet). I have set static IP's through /etc/networks/interfaces, so it should all be sweet. Can anyone point me in the direction of what might be causing my problem? It is eth0 (192.168.1.120) that is getting an IP from the dynamic range. eth1 seems unaffected. DHCP server is a Cisco 828 SHDSL Router.

    The only thing that I can find out of the ordinary is these entries from /var/log/messages. I am the only person with access to the machine, so no-one has restarted the network.

    May 28 05:38:17 localhost kernel: eth0: network connection down
    May 28 05:38:18 localhost kernel: eth0: network connection up using port A
    May 28 05:38:18 localhost kernel: speed: 100
    May 28 05:38:18 localhost kernel: autonegotiation: yes
    May 28 05:38:18 localhost kernel: duplex mode: half
    May 28 05:38:18 localhost kernel: flowctrl: none
    May 28 05:38:18 localhost kernel: irq moderation: disabled
    May 28 05:38:18 localhost kernel: scatter-gather: enabled
    May 28 05:38:28 localhost kernel: eth0: network connection down
    May 28 05:38:29 localhost kernel: eth0: network connection up using port A
    May 28 05:38:29 localhost kernel: speed: 100
    May 28 05:38:29 localhost kernel: autonegotiation: yes
    May 28 05:38:29 localhost kernel: duplex mode: half
    May 28 05:38:29 localhost kernel: flowctrl: none
    May 28 05:38:29 localhost kernel: irq moderation: disabled
    May 28 05:38:29 localhost kernel: scatter-gather: enabled


    This is what /etc/networks/interfaces looks like:

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # This is the internet interface
    auto eth0
    iface eth0 inet static
    address 192.168.1.120
    netmask 255.255.255.0
    gateway 192.168.1.1
    network 192.168.1.0
    broadcast 192.168.1.255

    # This is the internal NIC
    auto eth1
    iface eth1 inet static
    address 10.0.0.120
    netmask 255.0.0.0
    network 10.0.0.0
    broadcast 10.0.0.255
    Last edited by Pleiades; 05-29-2006 at 05:08 AM.

  2. #2
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935
    Quote Originally Posted by Pleiades
    I have set static IP's through /etc/networks/interfaces, so it should all be sweet.
    Well, I'm hoping that it was just a typo. Interfaces file is in /etc/network folder, NOT /etc/networks folder (actually, the networks is a file and not even a folder).

    Can anyone point me in the direction of what might be causing my problem? It is eth0 (192.168.1.120) that is getting an IP from the dynamic range.
    Strange in deed. Check if any dhcp services are starting before your networking module in /etc/rcS.d and /etc/rc5.d folders. If so, kill it (change file name to K instead of S)

    Other than that, I'm puzzled.
    LinuxVillage - The truely community run Linux/Floss forum !

    No IT BS !!

  3. #3
    Junior Member
    Join Date
    Jun 2001
    Location
    Melbourne, Australia
    Posts
    94
    Quote Originally Posted by Compunuts
    Well, I'm hoping that it was just a typo. Interfaces file is in /etc/network folder, NOT /etc/networks folder (actually, the networks is a file and not even a folder).
    A typo, indeed

    Check if any dhcp services are starting before your networking module in /etc/rcS.d and /etc/rc5.d folders. If so, kill it (change file name to K instead of S)
    I saw a post at some Debian site that made mention of the fact that if you set up the machine with a NIC initially set to DHCP, dhcp-client will run and get an address, even if you have now set the NIC to static. I've uninstalled dhcp-client, will see how it goes.

    Thanks.

  4. #4
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935
    Like I said, if you are not going to use DHCP, then just don't let it start. Go to /etc/rc*.d (* stands for 0 to 5 and S) and change file names from S**dhcp to K**dhcp and you should be good to go (S stands for Start, K stands for Kill).
    LinuxVillage - The truely community run Linux/Floss forum !

    No IT BS !!

  5. #5
    Junior Member
    Join Date
    Jun 2001
    Location
    Melbourne, Australia
    Posts
    94
    Was still doing it after removing dhcp-client, but there was nothing in any of the rc*.d directories. There was still a process running named dhclient, was linked to eth0, this was obviously my problem, but it isn't now. I killed process and all seems fine.

  6. #6
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935
    So you setup with dhcp and then assign manual IP and did ifconfig up/down but without rebooting? No need to reboot but you also need to re-start networking module, "service networking stop/start/restart".

    But if all is fine, then let it be.
    LinuxVillage - The truely community run Linux/Floss forum !

    No IT BS !!

  7. #7
    Junior Member
    Join Date
    Jun 2001
    Location
    Melbourne, Australia
    Posts
    94
    Quote Originally Posted by Compunuts
    So you setup with dhcp and then assign manual IP and did ifconfig up/down but without rebooting? No need to reboot but you also need to re-start networking module, "service networking stop/start/restart".
    Didn't do ifconfig up/down. I built the machine with DHCP (to get packages from Debian site), then after packages were installed, edited /etc/network/interfaces to apply static IP's to eth0 and eth1. I then ran "/etc/init.d/networking restart", then ifconfig to check that the IP had set, which it had. It all looked fine until I couldn't see it from teh net. That's when I discovered that some DHCP action was still going on. eth1 wasn't plugged in during the build, hence not affected.

    I only did the reboot to see if there was anything in startup that said do DHCP.

    Looks fine now, so me no touchy.

    Cheers.

Similar Threads

  1. setting static IP on network with no static IP address from internet provider?
    By solvetek in forum Linux - Hardware, Networking & Security
    Replies: 4
    Last Post: 11-16-2011, 07:23 AM
  2. Dynamic DNS with static IP configuration
    By nsvora in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 12-09-2006, 04:31 AM
  3. loosing RAID while changing IP from dynamic to static
    By rookie in forum Linux - Hardware, Networking & Security
    Replies: 1
    Last Post: 12-13-2005, 09:23 AM
  4. Dynamic IP
    By jro in forum Linux - General Topics
    Replies: 13
    Last Post: 08-09-2005, 01:43 PM
  5. Dynamic DNS
    By pyfsapple in forum Linux - Hardware, Networking & Security
    Replies: 0
    Last Post: 01-17-2003, 10:19 AM

Bookmarks

Posting Permissions

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