Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Option #1 - Manual configuration
    The VM appliance is a normal CentOS 7 system, hence all the mechanisms for network configuration in CentOS are available.
    Most specifically you'll be interested in the  files /etc/hosts, /etc/sysconfig/network, /etc/sysconfig/iptables and /etc/sysconfig/network-scripts/<interface_name>.
  • Option #2 - Use our example network configuration files

    Root's home directory contains 2 example network configurations, one for static IP's and one for DHCP.  Copy the one you require to /etc/sysconfig/network-scripts/ and edit it to suit:

    Code Block
    cp ifcfg-eth0ens192.static /etc/sysconfig/network-scripts/ifcfg-eth0

    Now set the IP, netmask, gateway, and DNS if you like ( to add DNS you can add two lines, one for each server: DNS1=ip , DNS2=ip similar to the  example below); finally, run service network restart to activate.

    Code BlockDEVICE="eth0" NM_CONTROLLED="yes" ONBOOT=yes TYPE=Ethernet BOOTPROTO=dhcp DEFROUTE=yes PEERDNS=yes PEERROUTES=yes IPV4_FAILURE_FATAL=yes NAME=eth0 HWADDR=08:00:27:F0:24:96 IPADDR=192.168.0.112 NETMASK=255.255.255.0 GATEWAY=192.168.0.1 DNS1=74.202.226.66 DNS2=74.202.226.65
    <interface_name>




Be sure to verify the following settings:

  • IPADDR
  • NETMASK
  • BROADCAST
  • GATEWAY
  • NAME; the interface name as found with the ip address command
  • DEVICE; the interface name as found with the ip address command
  • DNS;

Next restart the network service for the setting to take affect.  In our testing the DHCP address was still present, and the static IP assigned as a secondary (this can be seen with the 'ip address' command).  The DHCP address can be removed by using the 'ip address command del' command or be rebooting the system.


Code Block
TYPE=Ethernet
IPADDR=192.168.10.201
NETMASK=255.255.255.0
BROADCAST=192.168.10.255
GATEWAY=192.168.10.51
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=9099afe7-6dd6-4aec-bd93-8950b67ab8f5
DEVICE=enp0s3
ONBOOT=yes
DNS1=192.168.10.80
DNS2=8.8.8.8


Set Up Firewall (optional)

...