Search code examples
linuxubuntuinternet-explorercentos

My linux in WMware dose not have internet


I install Linux in VMWARE on a dedicated server but I do not have any internet connection. I can not ping anything. What should I do to have an internet connection?

I tried ubuntu, centos and different versions of them but still no internet connection. when I use the command IP a or ifconfig. It just show me a IO and nothing else.


Solution

  • for this first go to this location

    cd /etc/sysconfig/network-scripts/
    

    then use this command

    ifconfig
    

    you can see 2 flags one of them should be IO you should see what is the other flag name is. for example if it was eth0, in this location type

    nano ifcfg-eth0
    

    then paste this into this file remember change your IP, subnet mask and your gateway

    TYPE=Ethernet
    PROXY_METHOD=none
    BROWSER_ONLY=no
    BOOTPROTO=none
    DEFROUTE=yes
    IPV4_FAILURE_FATAL=no
    IPV6INIT=yes
    IPV6_AUTOCONF=yes
    IPV6_DEFROUTE=yes
    IPV6_FAILURE_FATAL=no
    IPV6_ADDR_GEN_MODE=stable-privacy
    NAME=ens33
    UUID=e6dd2f58-fc77-497f-a7ce-28e35ac4ba52
    DEVICE=ens33
    ONBOOT=yes
    IPADDR= "YOUR IP"
    PREFIX="SUBMASK"
    GATEWAY="GATEWAY"
    DNS1=8.8.8.8
    
    

    then restart your centos and you should have internet.