[LINUX] [ESXi (vCenter)] How to add NIC for CentOS 7.3

Introduction

This time, I would like to output how to add a CentOS 7.3 NIC on the ESXi host.

This environment

item Version etc.
HyperVisor ESXi6.7
OS CentOS7.3
[root@tspweb01 ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
[root@tspweb01 ~]#
[root@tspweb01 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:0c:29:ee:2e:ba brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.41/24 brd 192.168.0.255 scope global ens192
       valid_lft forever preferred_lft forever
    inet6 2404:7a80:91a1:4d00:20c:29ff:feee:2eba/64 scope global mngtmpaddr dynamic
       valid_lft 2591907sec preferred_lft 604707sec
    inet6 fe80::20c:29ff:feee:2eba/64 scope link
       valid_lft forever preferred_lft forever
[root@tspweb01 ~]#

Advance preparation

Shut down the OS.

(1) Check the host name and IP address. Is the target correct?

[root@tspweb01 ~]# uname -n;ip a
tspweb01
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:0c:29:ee:2e:ba brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.41/24 brd 192.168.0.255 scope global ens192
       valid_lft forever preferred_lft forever
    inet6 2404:7a80:91a1:4d00:20c:29ff:feee:2eba/64 scope global mngtmpaddr dynamic
       valid_lft 2591821sec preferred_lft 604621sec
    inet6 fe80::20c:29ff:feee:2eba/64 scope link
       valid_lft forever preferred_lft forever
[root@tspweb01 ~]#

② OS shutdown

[root@tspweb01 ~]# shutdown -h now

③ Confirm that the power is off 0.JPG

NIC addition procedure

VM settings

① Right-click the target machine and click "Edit Settings" 1-1.jpg

② Click "Add Network Adapter"

2-1.jpg

(3) A new network adapter will be added, so select the target network.

The settings are as follows.

item Setting
status □ Connect when power is on
Adapter type VMXNET3

network.JPG

④ After completing the settings, click "Save".

4.JPG

⑥ Confirm that "Reconfig VM" becomes "normal end". 5.JPG

⑦ Right-click the target machine and click "Power On"

6.JPG

OS settings

(1) Log in to the terminal with the terminal software and check the host name and IP address.

[root@tspweb01 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:0c:29:ee:2e:ba brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.41/24 brd 192.168.0.255 scope global ens192
       valid_lft forever preferred_lft forever
    inet6 2404:7a80:91a1:4d00:20c:29ff:feee:2eba/64 scope global mngtmpaddr dynamic
       valid_lft 2591717sec preferred_lft 604517sec
    inet6 fe80::20c:29ff:feee:2eba/64 scope link
       valid_lft forever preferred_lft forever
3: ens224: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 00:0c:29:ee:2e:c4 brd ff:ff:ff:ff:ff:ff
[root@tspweb01 ~]#

→ Confirm that "ens224" has been added

(2) Create a network config file

[root@tspweb01 network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-ens224

** [Details] **

TYPE=Ethernet
BOOTPROTO=none
IPV6INIT=no
NAME=ens224
HWADDR=00:0c:29:ee:2e:c4
DEVICE=ens224
ONBOOT=yes
IPADDR=192.168.0.42
PREFIX=24
GATEWAY=192.168.0.1

After setting, save with "wq".

** [Settings] **

item Description
TYPE type
BOOTPROTO When using DHCP"dhcp", If you want to set it statically"static"Or"none"
IPV6INIT Whether IPv6 setting is implemented
NAME NIC name
HWADDR MAC address of NIC
ONBOOT Whether to boot the NIC when the OS boots
IPADDR IP address(Static setting)
PREFIX sub-net mask
GATEWAY default gateway
3: ens224: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 00:0c:29:ee:2e:c4 brd ff:ff:ff:ff:ff:ff

→ The next part of "link / ether"

③ Check if the content is reflected

[root@tspweb01 network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-ens224
TYPE=Ethernet
BOOTPROTO=none
IPV6INIT=no
NAME=ens224
HWADDR=00:0c:29:ee:2e:c4
DEVICE=ens224
ONBOOT=yes
IPADDR=192.168.0.42
PREFIX=24
GATEWAY=192.168.0.1
[root@tspweb01 network-scripts]#

④ OS shutdown

shutdown -h now

(4) Return to the ESXi screen and open Edit VM Settings. 1-1.jpg

⑤ Enter ☑ in the status of the added network adapter. 8-1.jpg

⑥ Click "Save". 4.JPG

⑦ Power on the target machine. 9.JPG

⑧ After power-on is completed, log in to the server. After logging in, check the host name and IP address.

[root@tspweb01 ~]# uname -n;ip a
tspweb01
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:0c:29:ee:2e:ba brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.41/24 brd 192.168.0.255 scope global ens192
       valid_lft forever preferred_lft forever
    inet6 2404:7a80:91a1:4d00:20c:29ff:feee:2eba/64 scope global mngtmpaddr dynamic
       valid_lft 2591977sec preferred_lft 604777sec
    inet6 fe80::20c:29ff:feee:2eba/64 scope link
       valid_lft forever preferred_lft forever
3: ens224: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:0c:29:ee:2e:c4 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.42/24 brd 192.168.0.255 scope global ens224
       valid_lft forever preferred_lft forever
    inet6 2404:7a80:91a1:4d00:20c:29ff:feee:2ec4/64 scope global mngtmpaddr dynamic
       valid_lft 2591977sec preferred_lft 604777sec
    inet6 fe80::20c:29ff:feee:2ec4/64 scope link
       valid_lft forever preferred_lft forever
[root@tspweb01 ~]#

→ Confirm that the IP address set in ens224 is assigned.

⑨ Check if PING communication to the target IP address and SSH login are possible. 10.JPG

Reference article

About CentOS6 / 7 ifcfg and other configuration files

Recommended Posts

[ESXi (vCenter)] How to add NIC for CentOS 7.3
[For non-programmers] How to walk Kaggle
How to add sudo when debugging
How to install PyPy on CentOS
How to install TensorFlow on CentOS 7
How to add AWS EBS volume
How to install Maven on CentOS
(For myself) Flask_5 (Add to txt file)
How to add a package with PyCharm
How to create * .spec files for pyinstaller.
[Python] Organizing how to use for statements
How to switch mouse operations on CentOS
How to update security on CentOS Linux 8
How to use Pylint for PyQt5 apps
How to install Eclipse GlassFish 5.1.0 on CentOS 7
How to use "deque" for Python data
How to add python module to anaconda environment
How to install Apache (httpd) on CentOS8
How to add options to Django's manage.py runserver
How to use fingerprint authentication for KDE
How to install python3 with docker centos
How to specify the launch browser for JupyterLab 3.0.0
How to use MkDocs for the first time
How to make Spigot plugin (for Java beginners)
How to specify the NIC to scan with amazon-dash
How to use Template Engine for Network Engineer
How to install Python for pharmaceutical company researchers
How to use data analysis tools for beginners
How to add a Python module search path
How to write a ShellScript Bash for statement
How to create a shortcut command for LINUX
How to add Anaconda Powershell Prompt to Windows Terminal?
How to make Python faster for beginners [numpy]
[For beginners] How to study programming Private memo
How to find the correlation for categorical variables
[CentOS8] How to output Python standard output to systemd log
How to force build TensorFlow 2.3.0 for CUDA11 + cuDNN8
How to set CPU affinity for process threads
How to build two CentOS7 environments / Windows10 + VirtualBox + Vagrant
[BigQuery] How to use BigQuery API for Python -Table creation-
[For beginners] How to use say command in python!
How to convert Python # type for Python super beginners: str
[For beginners] How to study Python3 data analysis exam
How to run python in virtual space (for MacOS)
[Go] How to create a custom error for Sentry
How to make unit tests Part.2 Class design for tests
[Note] How to give sudo authority to user on CentOS
I thought about how to learn programming for free.
How to create a local repository for Linux OS
How to add page numbers to PDF files (in Python)
How to build a development environment for TensorFlow (1.0.0) (Mac)
[Morphological analysis] How to add a new dictionary to Mecab
Add D (any other language) to SublimeLinter for highlighting
How to add color bars in matplotlib bar plot
Python # How to check type and type for super beginners
Compare how to write processing for lists by language
[Introduction to Python] How to write repetitive statements using for statements