Network Configuration: Desktop Vs. Laptop

Home » CentOS » Network Configuration: Desktop Vs. Laptop
CentOS 2 Comments

Hi,

I’m just migrating some stuff from Slackware Linux to CentOS, and I have a question about the orthodox way of configuring a network connection.

On a desktop or workstation, I usually get rid of NetworkManager:

# systemctl stop NetworkManager
# yum remove NetworkManager

Then I edit the /etc/sysconfig/network-scripts/ifcfg-XXXXX file corresponding to my network interface. Here’s a working example:

# /etc/sysconfig/network-scripts/ifcfg-enp2s0
DEVICE=enp2s0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=dhcp

Now I wonder how I should configure things on a laptop, where I usually keep NetworkManager. On a Slackware system, it’s usually just a matter of leaving a pristine /etc/rc.d/rc.inet1.conf file, and then activate
/etc/rc.d/rc.networkmanager. Starting from there, when there’s a wireless connection available, I can connect using the little NetworkManager applet on the desktop. And when I switch to cable, NetworkManager will prefer that connection automagically.

On a default installation (I went for the KDE version), NetworkManager is active, so I’ll keep that. ‘ifconfig’ shows me that the cabled connection is up and running via enp3s0 on the laptop. Wireless doesn’t seem to work, but ‘ifconfig -a’ shows me a wlp2s0 interface, which means there’s a chance it will work.

First thing I did was edit ifcfg-enp3s0 like this:

DEVICE=”enp3s0″
TYPE=”Ethernet”
NM_CONTROLLED=”yes”

Then I edited ifcfg-wlp2s0 from scratch, since there’s nothing present:

DEVICE=”wlp2s0″
TYPE=”Wireless”
NM_CONTROLLED=”yes”

I rebooted (just to be on the safe side), and I have a partial success. I can connect via KDE’s NetworkManager applet. But when I plug in an Ethernet cable, the wireless connection stays up and is not replaced by the cabled connection.

Any suggestions?

Niki Kovacs

Microlinux – Solutions informatiques durables
7, place de l’église – 30730 Montpezat Web : http://www.microlinux.fr Mail : info@microlinux.fr Tél. : 04 66 63 10 32

2 thoughts on - Network Configuration: Desktop Vs. Laptop

  • Hi Niki,

    On CentOS it’s normal for both wireless and wired to be connected at the same time, maybe what you are seeing is just the icon’s being confusing or not being replaced with the right thing?

    This is easy to check, just issue an “ip route”. On My system I can see something like this:

    default via 192.168.0.1 dev eth0 proto static
    192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.16 metric 1
    192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.13 metric 2

    Routing will prefer eth0 (wired), with the smaller metric, giving you the better performance.

    I found this quite handy a couple of times, say you remove the laptop from the desk and go in the garden or something, you won’t lose your connections.


    Sent from the Delta quadrant using Borg technology!

    Nux!
    http://www.nux.ro

    —– Original Message —–

  • Le 09/04/2017 à 10:29, Nux! a écrit :

    Thanks, Lucian.

    I just found the culprit, though. Apparently the ifcfg- files
    (except ifcfg-lo) were interfering with NetworkManager, so I just deleted them, and now everything runs perfectly.

    Cheers,

    Niki


    Microlinux – Solutions informatiques durables
    7, place de l’église – 30730 Montpezat Web : http://www.microlinux.fr Mail : info@microlinux.fr Tél. : 04 66 63 10 32