Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to assign static IP address to Centos 7 with the commands
vim /etc/sysconfig/network-scripts/ifcfg-ens33
I can edit and it is saving but when i try checking for configs through ifconfig it is the same ip as of earlier through dhcp. using centos in a virtual environment of VMware.
Thanks, that did help. I was able to configure a static IP in centos but now it does not have any connectivity to internet.
I am using CENTOS 7 in VMWare, earlier the IP address (dhcp) was 192.168.139.135, but now when I assigned 192.168.139.100, it can neither ping any website or connect in any manner.
ping google.com
ping: unknown host google.com
this is the output when I try to do ping.
is there anything I am missing in vim /etc/sysconfig/network-scripts/ifcfg-ens33
Can you ping by ip#? Like: ping 8.8.8.8? IF not, post: ip a;ip r
DNS1=192.168.139.100 [==] IPADDR=192.168.139.100
doesn't look 'good IMHO': I doubt that this is its own DNS server! Try MAYBE:
DNS1=192.168.139.2 (the gw, or 8.8.8.8)
Following the advice given by Jjanel will determine if the problem is in the routing, or only in DNS resolution.
Generally, any good ISP will provide at least TWO DNS servers, but I always include a third that is a fast public DNS. The nameserver at 8.8.8.8 is a public DNS provided by google. They also provide a backup at 8.8.4.4, and LEvel3 communications offers 4.2.2.2, but there are MANY others. In your file settings are allowed for DNS1=, DNS2=, and DNS3=. Technically you can assign as many as you like, but the network stack will only ever use the first three: and only the first ONE if it always responds.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.