본문 바로가기
IT/LINUX

CentOS7 minimal 설치 후속 작업들

by SidePower 2022. 10. 1.

 

CentOS minimal 버전은 최소 버전으로

X Window가 아닌 CLI 방식의 텍스트 모드로 설치되며

리눅스 설치만 되어 있고 인터넷도 안돼요 ^^;;

 

그래서 제일 먼저 할 일은 네트워크 활성화부터 해야 됩니다.

네트워크 비활성화되어 있어 외부 통신이 전혀 안되고 있어요.

 

파일위치 : /etc/sysconfig/network-scripts

환경파일 : ifcfg-enp0s3

[root@localhost ~]# cd /etc/sysconfig/network-scripts
[root@localhost network-scripts]# vi ifcfg-enp0s3
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
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=ab24411e-0e8b-4581-8912-b15421807c80
DEVICE=enp0s3
ONBOOT=no     yes

vi ifcfg-enp0s3을 열어보면 마지막에 ONBOOT=no로 되어 있어요.

ONBOOT=yes로 변경해서 다시 재부팅하시면 네트워크 연결됩니다.

 

그리고 아래처럼 네트워크 관련 명령어도 설치가 안되어 있어요.

[root@localhost ~]# netstat -an
-bash: netstat: command not found

[root@localhost ~]# ifconfig
-bash: ifconfig: command not found

 

편하게 사용하기 위해 net-tools를 설치하겠습니다.

[root@localhost ~]# yum install net-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.kakao.com
 * extras: mirror.kakao.com
 * updates: mirror.kakao.com
base                                                                                                              | 3.6 kB  00:00:00
extras                                                                                                            | 2.9 kB  00:00:00
updates                                                                                                        | 2.9 kB  00:00:00
(1/4): base/7/x86_64/group_gz                                                           | 153 kB  00:00:00
(2/4): extras/7/x86_64/primary_db                                                   | 243 kB  00:00:00
(3/4): updates/7/x86_64/primary_db                                               |  12 MB  00:00:01
(4/4): base/7/x86_64/primary_db                                                      | 6.1 MB  00:00:03
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.25.20131004git.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================
 Package                       Arch                       Version                                      Repository                Size
==============================================================================
Installing:
 net-tools                     x86_64                     2.0-0.25.20131004git.el7                     base                     306 k

Transaction Summary
==============================================================================
Install  1 Package

Total download size: 306 k
Installed size: 917 k
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/base/packages/net-tools-2.0-0.25.20131004git.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for net-tools-2.0-0.25.20131004git.el7.x86_64.rpm is not installed
net-tools-2.0-0.25.20131004git.el7.x86_64.rpm                                                                  | 306 kB  00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-9.2009.0.el7.centos.x86_64 (@anaconda)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : net-tools-2.0-0.25.20131004git.el7.x86_64                                                                          1/1
  Verifying  : net-tools-2.0-0.25.20131004git.el7.x86_64                                                                          1/1

Installed:
  net-tools.x86_64 0:2.0-0.25.20131004git.el7

Complete!


[root@localhost ~]# netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN
tcp        0      0 10.0.2.15:22            10.0.2.2:13202          ESTABLISHED
tcp        0      0 10.0.2.15:22            10.0.2.2:13201          ESTABLISHED
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0 ::1:25                  :::*                    LISTEN


[root@localhost ~]# ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::6ad9:b57e:3888:cf5f  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:92:f4:0d  txqueuelen 1000  (Ethernet)
        RX packets 14120  bytes 20236779 (19.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6078  bytes 394468 (385.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 68  bytes 5896 (5.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 68  bytes 5896 (5.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

이 정도면 이제 하고 싶은 거 할 수 있어요.

 

또 필요한 게 생기면 그때그때 설치하면 될 거예요.

 

 

감사합니다.

반응형

댓글