[FIX] How to reset the firewall configuration in a persistent manner?

Question

Internet works, ping 192.168.1.4 which is for sure of an Android device does not. I believe it is an issue of the firewall programs.

$ ping 192.168.1.4
PING 192.168.1.4 (192.168.1.4) 56(84) bytes of data.
From 192.168.1.9 icmp_seq=1 Destination Host Unreachable
From 192.168.1.9 icmp_seq=2 Destination Host Unreachable
From 192.168.1.9 icmp_seq=3 Destination Host Unreachable
From 192.168.1.9 icmp_seq=4 Destination Host Unreachable
From 192.168.1.9 icmp_seq=5 Destination Host Unreachable
From 192.168.1.9 icmp_seq=6 Destination Host Unreachable
^C
--- 192.168.1.4 ping statistics ---
8 packets transmitted, 0 received, +6 errors, 100% packet loss, time 7147ms
pipe 3

I think the problem appeared when today I messed up with firewall-cmd and ufw.

I did this:

sudo firewall-cmd --zone=public --permanent --add-service=http

and the Internet did not work. Then, to undo:

sudo firewall-cmd --zone=public --permanent --remove-service=http

but the Internet was still not working.

But I did sudo ufw --force reset and then sudo ufw --force enable, then rebooted the laptop:

$ sudo ufw --force reset
Backing up 'user.rules' to '/etc/ufw/user.rules.20220304_134252'
Backing up 'before.rules' to '/etc/ufw/before.rules.20220304_134252'
Backing up 'after.rules' to '/etc/ufw/after.rules.20220304_134252'
Backing up 'user6.rules' to '/etc/ufw/user6.rules.20220304_134252'
Backing up 'before6.rules' to '/etc/ufw/before6.rules.20220304_134252'
Backing up 'after6.rules' to '/etc/ufw/after6.rules.20220304_134252'

But still the firewall rules are not reset. How can I reset the firewall rules?

Currently:

sudo ufw status numbered
Statut: inactiv (Status: inactive)

If I disable/enable the firewall with sudo ufw --force with disable/enable the Internet works in both ways, but none of these commands make the ping towards the Android device work.

arp -a

? (192.168.1.1) at 70:9f:2d:bc:3d:0c [ether] on enp1s0
tab-s6-al-utilizatorului-silviu (192.168.1.4) at <incompletă> on enp1s0

ip -4 neigh

192.168.1.1 dev enp1s0 lladdr 70:9f:2d:bc:3d:0c REACHABLE
192.168.1.4 dev enp1s0  FAILED

Update 1

Relevant question: From 192.168.0.146 icmp_seq=1 Destination Host Unreachable.

Update 2

I do not comprehend why arp -a shows the name of the device I am looking for if the device is not seen.

Screenshot of the device connected with the IP 192.168.1.4:

screenshot

Click Here to see answer

0
payam 7 months 2022-03-05T09:26:36+00:00 0 Answers 3 views

Leave an answer

By answering, you agree to the Terms of Service and Privacy Policy.