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
    0.0.0.0 192.168.11.1 0.0.0.0 UG 0 0 0 enp3s0
    192.168.11.0 0.0.0.0 255.255.255.0 U 0 0 0 enp3s0

    $ grep -v ^# /usr/lib/systemd/network/12_my__wlp2s0.network

    [Match]
    Name=wlp2s0

    [Network]
    Description=WIFI
    DNS=127.0.0.1

    [Address]
    Address=192.168.11.6/24


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


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

    addr=192.168.11.6
    mask=24



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

    [Unit]
    Description=netgear wireless network connectivity (wlp2s0)
    Wants=network.target
    Before=network.target
    BindsTo=sys-subsystem-net-devices-wlp2s0.device
    After=sys-subsystem-net-devices-wlp2s0.device

    [Service]
    Type=oneshot
    RemainAfterExit=yes
    EnvironmentFile=/etc/conf.d/wireless-netgear

    ExecStart=/usr/bin/rm -f /etc/systemd/network/12_my__wlp2s0.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 192.168.11.1 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 192.168.11.1 dev enp3s0 proto static
    ExecStop=/usr/sbin/ip link set wlp2s0 down
    ExecStop=/usr/sbin/ip route delete dev wlp2s0 192.168.11.0/24
    ExecStop=/usr/bin/ln -sf /dev/null /etc/systemd/network/12_my__wlp2s0.network

    [Install]
    WantedBy=multi-user.target
     
    Bit Twister, Sep 19, 2015
    #1
    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
    #2
    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
    #3
  4. Bit Twister

    Bit Twister Guest

    You did not read the original post carefully.

    Reboot,
    route -n shows gateway dev enp3s0
    no wlp2s0 in table
    ping yahoo.com works through wired nic

    systemctl start wireless-netgear
    route -n shows gateway dev wlp2s0
    ping yahoo.com 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
    #4
  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.

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

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

    *CUT*
     
    Eric Pozharski, Sep 20, 2015
    #5
  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
    #6
  7. Bias warning: I don't do svchost thing. IDK, drop this line maybe.
    Looks insane but might work.

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