0

I want to use wifi to connect to the internet

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
default         fritz.box       0.0.0.0         UG        0 0          0 wlp3s0
192.168.37.0    0.0.0.0         255.255.255.0   U         0 0          0 wlp3s0

This is the effect of the automatic configuration through NetworkManager. So far so good.

The problem is: once I add an ethernet connection with a manual IP, I get the following effect

 Kernel IP routing table
 Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
 default         169.254.100.100 0.0.0.0         UG        0 0          0 enp0s20u2u3
 default         fritz.box       0.0.0.0         UG        0 0          0 wlp3s0
 169.254.100.0   0.0.0.0         255.255.255.0   U         0 0          0 enp0s20u2u3
 192.168.37.0    0.0.0.0         255.255.255.0   U         0 0          0 wlp3s0

Now I cannot connect to the internet anymore.

I guess the question is: how to configure the ethernet profile to not set a default gateway?

I am on Fedora25.

2

You can try editing the init-scripts in /etc/sysconfig/network-scripts/. If one doesn't exist for the profile you can create it manually via terminal; or, if you go to "Add Profile" via Settings. Then, add/edit the following:

DEFROUTE=no

You might also have to add/edit the following:

PEERROUTES=no

Using nmcli

Alternatively, using the NetworkManager commandline tool, nmcli, do:

nmcli con modify eth0 ipv4.never-default yes

Note: eth0 is the name of the connection NOT the name of the interface! To get the name of the connection you want/need, list the active profiles

# nmcli con show
NAME       UUID                                  TYPE            DEVICE 
eth0     c0ab4c5a-0edb-a1b4-2a33-dba7a31033e  802-3-ethernet     eth0 

You can access the nmcli editor via

 # nmcli con edit eth0
nmcli> describe ipv4.never-default

=== [never-default] ===
[NM property description]
If TRUE, this connection will never be the default connection for this IP type, meaning it will never be assigned the default route by NetworkManager.

For additional information on nmcli, and specific examples using it, take a look at https://people.freedesktop.org/~lkundrak/nm-docs/nmcli-examples.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.