need some "ip" commands/network setup help

Discussion in 'Linux Networking' started by Bit Twister, Sep 19, 2015.

  1. Bit Twister

    Bit Twister Guest

    I need a subject matter expert/wizard to show me where I am going
    wrong or what I need to change in my wireless-netgear.service file.

    Problem is I can boot the system, run systemctl start systemd-networkd
    and route -n looks/works and the wireless connection works fine.

    Running Mageia Linux release 5, systemd-networkd.service .

    I run systemctl stop systemd-networkd
    and later systemctl start systemd-networkd fails.

    Running ExecStart= commands in a root terminal suggest the problem happens here:

    # /usr/sbin/ip -d addr add ${addr}/${mask} dev wlp2s0
    RTNETLINK answers: File exists

    journal and systemctl status systemd-networkd provide no useful information.

    $ ifconfig | grep ': '
    enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536

    $ route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface UG 0 0 0 enp3s0 U 0 0 0 enp3s0

    $ grep -v ^# /usr/lib/systemd/network/




    $ ls -al /etc/systemd/network/
    lrwxrwxrwx 1 root root 9 Sep 19 15:22 /etc/systemd/network/ -> /dev/null

    $ grep ^# /etc/conf.d/wireless-netgear


    $ grep -v ^# /usr/lib/systemd/system/wireless-netgear.service

    Description=netgear wireless network connectivity (wlp2s0)


    ExecStart=/usr/bin/rm -f /etc/systemd/network/
    ExecStart=/usr/bin/rm -rf /run/wpa_supplicant
    ExecStart=/usr/sbin/ip link set wlp2s0 down
    ExecStart=/usr/sbin/ip link set wlp2s0 up
    ExecStart=/usr/sbin/ip route del default
    ExecStart=/usr/sbin/wpa_supplicant -B -i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant-netgear.conf
    ExecStart=/usr/sbin/ip addr add ${addr}/${mask} dev wlp2s0
    ExecStart=/usr/sbin/ip ro add default via dev wlp2s0 proto static

    ExecStop=/usr/bin/pkill wpa_supplicant
    ExecStop=/usr/sbin/ip addr flush dev wlp2s0
    ExecStop=/usr/sbin/ip route del default
    ExecStop=/usr/sbin/ip ro add default via dev enp3s0 proto static
    ExecStop=/usr/sbin/ip link set wlp2s0 down
    ExecStop=/usr/sbin/ip route delete dev wlp2s0
    ExecStop=/usr/bin/ln -sf /dev/null /etc/systemd/network/

    Bit Twister, Sep 19, 2015
    1. Advertisements

  2. Make sure all devices are listed in /etc/shorewall/interfaces.
    Any changes to that file will likely require a reboot.

    Regards, Dave Hodgins
    David W. Hodgins, Sep 20, 2015
    1. Advertisements

  3. I should have added, I just ran into similar problems upgrading my main
    system from Mageia 4 to 5. Had to remove '/etc/udev/rules.d/70-persistent-net.rules', and reboot. That changed the nic from eth0 to enp7s0. I also
    had to change the nic in /etc/shorewalls/interfaces to avoid being spammed
    by shorewall messages.

    My other computer, which I upgraded when Mageia 5 was first in testing
    had no problems. I don't know why my newer computer had a problem, and
    don't have enough info for a proper bug report.

    Regards, Dave Hodgins
    David W. Hodgins, Sep 20, 2015
  4. Bit Twister

    Bit Twister Guest

    You did not read the original post carefully.

    route -n shows gateway dev enp3s0
    no wlp2s0 in table
    ping works through wired nic

    systemctl start wireless-netgear
    route -n shows gateway dev wlp2s0
    ping works through wlp2s0

    systemctl stop wireless-netgear

    route -n shows gateway dev enp3s0

    systemctl start wireless-netgear fails every time.
    Bit Twister, Sep 20, 2015
  5. *SKIP*
    My experience with iproute suggests this message means that
    ${addr}/${mask} already exists. Sure, it would be nice if iproute's
    messages would be more informative. But that's the way it is.

    Because wpa_supplicant already added it. (It might be different
    wpa_supplicant though.)

    A way I interpret this one is *you* can't have two simultaneous wireless
    connections. Ouch?

    Eric Pozharski, Sep 20, 2015
  6. Bit Twister

    Bit Twister Guest

    Yep, I just need to know what I need to do to clear the problem.
    All the preceding ExecStart=commands are my attempt to not have the problem.
    At the moment, true. All the ExecStop= commands are an attempt to make
    the system look the same after a reboot.
    Bit Twister, Sep 20, 2015
  7. Bias warning: I don't do svchost thing. IDK, drop this line maybe.
    Looks insane but might work.

    Eric Pozharski, Sep 21, 2015
    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.