Buscar este blog

sábado, 30 de diciembre de 2017

Centos 7.x - Minimal network setup

This is a continuation of a previous post, but this time dedicated to CentOS 7 (our customer is evolving!!)

Environment:
  • Virtualbox 5.1.10
  • CentOS 7.4.1708
Before start with the installation, in Virtualbox you have to configure two network adapters:
  • Adapter 1: Host only
  • Adapter 2: NAT
The first one will be used to communicate host and guest, for example, by using a ssh connection. The second one will be used by the guest in order to gain direct access to the internet.

When CentOS starts for first time, you will already had internet access. But local network will be disabled. Execute the following command to check your network interfaces:
ip add

The result will be something like this:


Here you can see three interfaces:
  • lo: Loopback
  • enp0s3: Host-Only adapter
  • enp0s8: NAT adapter
If you have doubts about which is the host-only, you can check the MAC address and compare it with the Virtualbox adapter.


Once you are sure enp0s3 is your interface, go to /etc/sysconfig/network-scripts/ and edit ifcfg-enp0s3 file, for example with vi. You will have to make two changes:
  • Set BOOTPROTO=none
  • Set ONBOOT=yes
  • Add IPADDR=your IP

Then execute the following command:
systemctl restart network.service

Now you will have your interface up and with the IP address you set before.


Note

As stated in my previous post, remember to configure proxy settings for system and yum configuration:

System config

Edit ~/.bash_profile file and add the following lines:

# The Web proxy server used by this account
http_proxy="http://usuario:password@my.proxy:8080"
export no_proxy=localhost,127.0.0.1
export http_proxy

YUM config

Edit  /etc/yum.conf y add the following lines:

# The proxy server - proxy server:port number
proxy=http://my.proxy:8080
# The account details for yum connections
proxy_username=usuario
proxy_password=password

No hay comentarios:

Publicar un comentario