Results 1 to 4 of 4

Thread: DHCP hijacks static IP and route in /etc/sysconfig/network

  1. #1

    Default DHCP hijacks static IP and route in /etc/sysconfig/network

    Hi, I have leap 15.3., I've been on dhcp, but now I want to switch to static IP only. So I did this:

    Code:
    me@opensuse:~> cat /etc/sysconfig/network/ifcfg-eth0
    BOOTPROTO='static'
    #ZONE=''
    IPADDR='10.0.0.71'
    MTU='1500'
    NAME=''
    NETMASK='255.255.255.128'
    STARTMODE='auto'
    USERCONTROL='no'
    me@opensuse:~> cat /etc/sysconfig/network/routes
    default 10.0.0.1 - -
    Before editing resolv.conf, I have replaced NETCONFIG_DNS_POLICY="auto" with "" in /etc/sysconfig/network/config like this:
    NETCONFIG_DNS_POLICY=""
    and placed in resolv.conf
    Code:
    me@opensuse:~> cat /etc/resolv.conf
    nameserver 1.1.1.1
    nameserver 1.0.0.1
    Nonetheless IP and route settings in config files have no effect, everything is still replaced by dhcp. Settings I wrote into /etc/resolv.conf vaporised everytime I reboot, but I managed to resolve it by rm /etc/resolv.conf and creating it again, because it was a symlink to /run. I'm using NetworkManager instead of wicked, so I cannot edit network via yast, but even if I could, I'd like to manage that myself ;-) My interface is really eth0, not that enpwhatever.

    Thank you.

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    30,938

    Default Re: DHCP hijacks static IP and route in /etc/sysconfig/network

    Why didn't you use the YaST module for this. There one of the items is to choose if you want to use DHCP and you can configure all the rest also there.
    Henk van Velden

  3. #3
    Join Date
    Sep 2012
    Posts
    7,856

    Default Re: DHCP hijacks static IP and route in /etc/sysconfig/network

    Quote Originally Posted by kmeleon View Post
    I'm using NetworkManager
    Which never used configuration files in /etc/sysconfig/network so your changes there are irrelevant.
    I'd like to manage that myself
    Use NetworkManager GUI provided by your desktop environment, use nmtui or nmcli or edit NetworkManager connection definitions directly. It is up to you. But you have to use tools and configuration files suitable for the program that manages your network.

  4. #4

    Default Re: DHCP hijacks static IP and route in /etc/sysconfig/network

    Quote Originally Posted by arvidjaar View Post
    Use NetworkManager GUI provided by your desktop environment, use nmtui or nmcli or edit NetworkManager connection definitions directly.
    Thank you, nmtui worked, I have no DE installed, only openbox. I'm using networkmanager, because it is on other distros too, and during install I can choose to use either wicked, or networkmanager. If I could, I'd not use any of them, but I don't know how

    Quote Originally Posted by hcvv View Post
    Why didn't you use the YaST module for this. There one of the items is to choose if you want to use DHCP and you can configure all the rest also there.
    Because yast is addictive, not available on other systems and I don't want to get addicted

Tags for this Thread

Posting Permissions

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