Fedora 43 Ethernet Connection configuration SELinux problem

Hello, I’m an advanced beginner with Linux and I’m having an issue setting up a wired Ethernet connection to the internet. Here is what I have done, but I still cannot get a connection to the internet due to SELinux blocking connection. I did want to mention that I tried relaxing the SELinux settings, and the Fedora security locked up my operating system to where I had to do a fresh install again. Any guidance would be appreciated.

ip link show

enp0s20f0u4

sudo dnf install dhcpcd

sudo dhcpcd enp0s20f0u4

SELinux error:

You can generate a local policy module to allow this access.

Allow this access for now by executing:

# ausearch -c 'dhcpcd-run-hook' --raw | audit2allow -M my-dhcpcdrunhook

# semodule -X 300 -i my-dhcpcdrunhook.pp

Ran both above under sudo and did ping google.com with the following output generated:

ping: google.com: Temporary failure in name resolution

Still unable to connect to the internet with Ethernet connected from router to laptop computer.

NetworkManager says that I’m connected, but I’m actually not connected.

Welcome to fedora @wstrauss123

With resolvectl you should see if you have a dns server specified.
Otherwise you will not be able to resolve names as google.com.

Can you ping 8.8.8.8 for example?

Thank you for replying. Correction. I got the following output:

strauss123@fedora:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
^C
--- 8.8.8.8 ping statistics ---
40 packets transmitted, 0 received, 100% packet loss, time 39947ms
wstrauss123@fedora:~$ resolvectl
Global
         Protocols: LLMNR=resolve -mDNS -DNSOverTLS DNSSEC=no/unsupported
  resolv.conf mode: stub

Link 2 (enp0s20f0u4)
    Current Scopes: LLMNR/IPv4 LLMNR/IPv6
         Protocols: -DefaultRoute LLMNR=resolve -mDNS -DNSOverTLS
                    DNSSEC=no/unsupported
     Default Route: no

Link 3 (wlo1)
    Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
         Protocols: +DefaultRoute LLMNR=resolve -mDNS -DNSOverTLS
                    DNSSEC=no/unsupported
Current DNS Server: 75.75.75.75
       DNS Servers: 2001:558:feed::1 2001:558:feed::2 75.75.75.75 75.75.76.76
     Default Route: yes
wstrauss123@fedora:~$

Edited: The above is with my wifi connection on. Still same output for Ethernet card with wifi turned off for my Ethernet card.

Before we continue please whatch that you format your terminal output as pre formatted text. it looks better and it is easy readable. You can do that while clicking on the </> icon in the editor.

The initial request I formatted already for you.

What Desktop Environment are you using?

Thanks, will do. I’m running Fedora 43 Cinnamon edition.

dhcpd is for running a DHCP server on your own network, on a router.
It is not required if all you want to do is resolve DNS lookups.

Can you show the output of ip addr and ip route when only the wired connect is connected please?

If selinux gets into a terrible mess turning it off on the kernel command line usually allows your system to boot and then you can look to repair selinux.

Thank you Barry. Here is the output with my wifi turned off:

wstrauss123@fedora:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: enp0s20f0u4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:e0:4c:68:05:ad brd ff:ff:ff:ff:ff:ff
    altname enx00e04c6805ad
    inet 169.254.245.104/16 brd 169.254.255.255 scope link noprefixroute enp0s20f0u4
       valid_lft forever preferred_lft forever
    inet6 fe80::e6b4:3cce:8e2d:507d/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: wlo1: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 12:2b:b6:65:d3:95 brd ff:ff:ff:ff:ff:ff permaddr b8:82:f2:c2:53:c9
    altname wlp1s0
    altname wlxb882f2c253c9

wstrauss123@fedora:~$ ip route
default via 192.168.4.1 dev enp0s20f0u4 proto static metric 100 
169.254.0.0/16 dev enp0s20f0u4 proto kernel scope link src 169.254.245.104 metric 100 
192.168.4.1 dev enp0s20f0u4 proto static scope link metric 100 
wstrauss123@fedora:~$

Your system is not getting an IP address from the router.
169.254.0.0/16 is auto configured if there is no DHCP on your network.

Check that you have cabled your wired port into an appropiate socket on the router.

I believe that the SELinux is blocking some components of the DHCP from working. My cable is plugged in correctly. Likely, the code to the DHCP needs to boot up in the correct sequence and SELinux is blocking a couple of the processes.

That would be surprising, are you seeing selinux errors?

You can prove this by changing selinux to permissive more so that it stop blocking operations.

  1. Edit /etc/sysconfig/selinux
  2. change SELINUX= to be SELINUX=permissive
  3. reboot

Does you network work now? Use ip addr to see what address your machine gets.

Thank you Barry. You were on point with my Ethernet cable connection. I unplugged my Ethernet cable from the modem and plugged it into the router (correct device) and restarted my laptop, and now the Wired Ethernet connection is working correctly with no Wifi enabled. I did change the NetworkManager GUI to Auto from static also.

I do not have much system admin skills at all. You’ve helped me out greatly. You Rock! Thank you!

1 Like

Thank you Wikipedia Brown too!

1 Like

Here is the ip addr now:

wstrauss123@fedora:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: enp0s20f0u4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:e0:4c:68:05:ad brd ff:ff:ff:ff:ff:ff
altname enx00e04c6805ad
inet 169.254.245.104/16 brd 169.254.255.255 scope link noprefixroute enp0s20f0u4
valid_lft forever preferred_lft forever
inet 192.168.4.21/22 brd 192.168.7.255 scope global dynamic noprefixroute enp0s20f0u4
valid_lft 13792sec preferred_lft 13792sec
inet6 fd74:ba32:8847:1:fe4b:c89e:4b73:57f0/64 scope global dynamic noprefixroute
valid_lft 2591607sec preferred_lft 604407sec
inet6 2601:281:d87e:ffd9:de29:b775:f449:bf96/64 scope global dynamic noprefixroute
valid_lft 3599sec preferred_lft 3599sec
inet6 fe80::e6b4:3cce:8e2d:507d/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: wlo1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether f2:74:17:82:c1:8a brd ff:ff:ff:ff:ff:ff permaddr b8:82:f2:c2:53:c9
altname wlp1s0
altname wlxb882f2c253c9
wstrauss123@fedora:~$

1 Like