I install CentOS-7-x86_64-Minimal-1611 on vmware. In the first part, after enabled dhclient I can install and download using commands but I set static IP to avoid to use dhclient command every after reboot. But after reboot commands like
yum install wget
return me errors like this
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_6 4&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org;
or also
failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl #6 - "Could not resolve host: mirror.centos.org;
It works only if I change
BOOTPROTO=static
into
BOOTPROTO=dhcp
but why I can't no set a static IP ?
After installed on vmware, I choose bridge mode and I follow this commands to set correctly IP but after reboot something should be wrong
This is what I did
systemctl status NetworkManager
nmcli d
ens33 --> ethernet name
systemctl stop NetworkManager
dhclient
ip addr show
192.168.1.6 --> IP
192.168.1.255 --> broadcast
cd /etc/sysconfig/network-scripts/
cat ifcfg-ens33
yum provides ifconfig
yum install net-tools
ifconfig -a
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.6 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::20c:29ff:fe1b:749f prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:1b:74:9f txqueuelen 1000 (Ethernet)
RX packets 223 bytes 20753 (20.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 155 bytes 37073 (36.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 588 bytes 50868 (49.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 588 bytes 50868 (49.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
yum install nano
Now I use putty
cd /etc/sysconfig/network-scripts/
nano ifcfg-ens33
I edit so
TYPE=Ethernet
BOOTPROTO=static
IPADDR=192.168.1.6
BROADCAST=192.168.1.255
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=ens33
UUID=b7982a78-da67-487f-bca9-3adec9dec4e2
DEVICE=ens33
ONBOOT=yes
systemctl restart network
ip add
ping 8.8.8.8
packets received
I check if interface is on
systemctl start NetworkManager
nmcli d
green -> connected
I kill dhclient
systemctl stop NetworkManager
ps -ef | grep dhclient
I see processes like this
root 10217 1 0 12:32 ? 00:00:00 dhclient
root 10790 10299 0 12:43 pts/0 00:00:00 grep --color=auto dhclient
I kill 10217 process
kill 10217
ps -ef | grep dhclient
then
systemctl restart network
systemctl start NetworkManager
reboot
enter again, user/password
nmcli d
systemctl status NetworkManager
is ok and active
now and only now I can reconnect with putty
I type
yum install wget
but return me errors like Could not retrieve mirrorlist