Configure Static IP Address in CentOS 7.6 Virtual Box

  1. Set virtual box like this:
  2. Log into Linux Centos and edit the file:

    vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 and modify the configuration like this in order to have a fix ip in your network and permit you to enter with a ssh console. (you have to modify the ip according to your network configuration.)

    TYPE=Ethernet
    PROXY_METHOD=none
    BROWSER_ONLY=no
    BOOTPROTO=static
    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=enp0s3
    UUID=6d9a4e86-ae47-456d-97ae-93ce156f9cd9
    DEVICE=enp0s3
    ONBOOT=yes
    IPADDR=192.168.178.131
    NETMASK=255.255.255.0
    GATEWAY=192.168.178.1
    BNS=8.8.8.8
    

     

  3. Modify the file /etc/resolv.conf like :
    nameserver 8.8.8.8
    
  4. restart the network service :service network restart
  5. check the configuration: ifconfig or ping your gateway

Leave a Reply