How to fix connectivity issue CentOS7

Symthoms

When you use curl, wget, yum timeout but the internet connection works well when you use a web browser

Cause

IPV6 is causing confusion on the network configuration routes

Fix

Disable SELinux (Optional but this generally fixes some app issues)

#/etc/sysconfig/selinux
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - No SELinux policy is loaded.
SELINUX=disabled  (default was 'enforcing')

sudo reboot -h now

Add DNS into the NIC

sudo vim /etc/sysconfig/network-scripts/ifcfg-enp0s3
DNS1=8.8.8.8
DNS2=8.8.4.4
PEERDNS=no

 sudo systemctl restart  network

then

# /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

sudo sysctl -p