Find the answer to your Linux question:
Results 1 to 9 of 9
When I got back from vacation yesterday I discovered that my MythDora backend had a different IP. The DHCP settings on the router specify that it is supposed to only ...
  1. #1
    Just Joined!
    Join Date
    Dec 2006
    Posts
    13

    [SOLVED] Something is overwriting my network settings

    When I got back from vacation yesterday I discovered that my MythDora backend had a different IP. The DHCP settings on the router specify that it is supposed to only lease the IP 192.168.2.209, yet it had somehow acquired the address 192.168.2.200.

    Every time I reboot it's the same.

    This is an issue for several reasons--one, the router is still expecting to forward http and ssh requests to this IP, so external connectivity is now lost. Two, the frontend requires a static IP to access media files and mysql. And finally, all the laptops in the house have mapped that IP to their Z: drive (for browsing via Samba).

    I can ssh in and manually change the IP (sudo ifconfig eth0 192.168.2.209) but for some reason it can't "get out" to the internet (it can no longer resolve any addresses or ping any IPs), although the frontend and samba clients can still see it and it can still ping the router.

    I've tried editing /etc/sysconfig/network-scripts/ifcfg-eth0 -- it specifies that eth0 should have a static IP of 192.168.2.209, yet this is ignored.

    Any ideas?

  2. #2
    Just Joined! Tarthen's Avatar
    Join Date
    Sep 2009
    Location
    Australia
    Posts
    40
    Here's what you need to do.

    Get rid of network-manager, if installed. Then, edit /etc/network/interfaces.

    Put this in.

    auto eth0
    iface eth0 inet static
    address 192.168.2.209
    netmask 255.255.255.0
    gateway ROUTERIPHERE

    Replace "routeriphere" with... well, your router. Then reboot. Ding! It should work perfectly.

  3. #3
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    What you really need to do is turn off DHCP on this system and put in a static IP Address.
    Sounds like your DHCP server is not setup properly and you really should not be using DHCP for a device that requires a static address.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  4. #4
    Just Joined!
    Join Date
    Dec 2006
    Posts
    13
    Quote Originally Posted by Tarthen View Post
    Here's what you need to do.

    Get rid of network-manager, if installed. Then, edit /etc/network/interfaces.

    Put this in.

    auto eth0
    iface eth0 inet static
    address 192.168.2.209
    netmask 255.255.255.0
    gateway ROUTERIPHERE

    Replace "routeriphere" with... well, your router. Then reboot. Ding! It should work perfectly.
    It does, but now I have to go in and bring eth0 up manually. It's not coming up at boot.

    When it is up, it does have the correct IP.

    What you really need to do is turn off DHCP on this system and put in a static IP Address.
    Sounds like your DHCP server is not setup properly and you really should not be using DHCP for a device that requires a static address.
    I'm aware of this, but I specified above that I was NOT trying to lease an IP; the static IP was being ignored (apparently this was Network-Manager).

    Everything is fine right now, at least until the next reboot. For a headless server, dragging out the keyboard and monitor every reboot is a pain

  5. #5
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    Post the contents of '/etc/sysconfig/network-scripts/ifcfg-eth0'
    Sound like you don't have this file setup correctly. Here is what mine looks like:

    Code:
    # Broadcom Corporation NetXtreme BCM5782 Gigabit Ethernet
    DEVICE=eth0
    BOOTPROTO=static
    DHCPCLASS=
    HWADDR=00:11:0A:3F:08:EF
    IPADDR=x.x.x.x
    NETMASK=255.255.255.192
    ONBOOT=yes
    Also use chkconfig' to see if your network is turned on.
    I have no issues here with this setup.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  6. #6
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    Isn't it easier to tell your router to assign you the IP through dhcp?

  7. #7
    Just Joined!
    Join Date
    Aug 2009
    Posts
    76
    Yes it is. If your computer is using DHCP that means that your router is assigning it an IP address. If that IP address is changing unexpectedly, then its typically better to log into the router and add a 'DHCP reservation' -- which reserves a specific IP address to a certain computer, and everytime that computer connects to the network, it will automatically be assigned the specified IP address.

    In other words, it effectively makes that IP into a static IP.

  8. #8
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    There is no guarantee that the dhcp server won't give that IP elsewhere unless it is reserved either, so you can't just assign a static IP on a dhcp network. As I write this I see that OP has assigned the IP in router, I would restart the router and then restart your machine, sometimes it will keep using a lease.

  9. #9
    Just Joined!
    Join Date
    Dec 2006
    Posts
    13
    Sorry for the late response, I've been traveling

    My /etc/sysconfig/network-scripts/ifcfg-eth0:
    # nVidia Corporation MCP67 Ethernet
    DEVICE=eth0
    BOOTPROTO=none
    HWADDR=00:23:54:d8:ab:80
    ONBOOT=yes
    IPADDR=192.168.2.209
    NETMASK=255.255.255.0
    USERCTL=no
    IPV6INIT=no
    NM_CONTROLLED=no
    GATEWAY=192.168.2.1
    TYPE=Ethernet
    Apparently I have not been clear with my network setup because there is way too much discussion on this.

    My router is an appliance provided by Deutsche Telekom. I wanted the mythbackend to have a static IP (useful for samba, necessary for the mythfrontend to find it, etc.) so I told the router to reserve 192.168.2.209 to 00:23:54:d8:ab:80 (the MAC address for eth0 on the backend).

    For some reason, the router stopped handing out 192.168.2.209 to the server via DHCP--it was instead leasing it 192.168.2.200. So now I just want to have it as a static IP without talking to the DHCP server at all.

    I just rebooted and the interface was up after book. I suspect that the cause was that I had not specified network services to be on after boot (chkconfig network on).

    Thanks for the assistance everyone!

Posting Permissions

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