반응형

[Linux Setting] CentOS 6.9 Setting Guide : 패키지관리 : X Window 설치

1. 용도 및 목적

Linux 설치 및 다양한 테스트 환경을 만들기 위함, X window 설치, 오라클 같이 GUI 환경 설치가 필요한 부분에 사용할수도 있고, 웹이나 기타 관리에 있어서 필요한 부분이 있다.

2. 설치 환경

-O/S

 Windows 10 Pro , VirtualBox(CentOS6.9)

-H/W

 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz

 RAM 8GB

 SDD 256GB

3. 패키지 설치 진행(local 저장소 사용)

-X 윈도우 그룹패키지 설치(GUI를 KDE Decktop 사용시 Desktop 대신 넣으면 됩니다.)

# yum groupinstall "X Window System" "Desktop" "Fonts" "Korean Support [ko]" 

-초기 OS 설치시에는 하기 항목에서 선택하여 설치

-y 입력하여 진행

-설치 완료 후 설치 된 패키지 확인

-부팅 모드 변경(runlevel 3 에서 5로 변경 저장)

#vi /etc/inittab
id:5:initdefault:

-재기동

#reboot

-기동 후 바로 웰컴 문구 ->Forward

-License Information -> yes 선택 상태 -> Forward

-Create User (생성안함) -> Forward

-yes

-Date and Time -> Forward

-kdump -> Finish

-yes(재기동 됨)

-부팅 화면

-참고 : minimal로 설치 할때 직접 Network(bond0)를 생성해주었는데, Desktop 그룹이 설치되며, NetworManager(네트워크에 이상 현상이 나오니 제거를 한다. ) 가 설치 된다. (네트워크가 끊어지니, 로컬 화면에서 진행한다.)

아래와 같이 진행한다.(chkconfig 는 runlevel 에 대해 재기동여부 설정함)
chkconfig NetworkManager off
service NetworkManager stop
service network restart



반응형
반응형

[Linux Setting] CentOS 6.9 Setting Guide : 패키지 관리: man 설치

1. 용도 및 목적

Linux 설치 및 다양한 테스트 환경을 만들기 위함, minimal로 설치하고 우연찮게 man 을 보려고 했으나, man 도 설치가 안되어있다. 간단하게 명령어나 패키지 메뉴얼 파일이라고 보면 된다.

2. 설치 환경

-O/S

 Windows 10 Pro , VirtualBox(CentOS6.9)

-H/W

 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz

 RAM 8GB

 SDD 256GB

3. 진행

-확인

[root@systemeng ~]# man 명령어
-bash: man: command not found

-설치

[root@systemeng ~]# yum install man
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
local                                                                    | 4.0 kB     00:00 ...
Resolving Dependencies
--> Running transaction check
---> Package man.x86_64 0:1.6f-39.el6 will be installed
--> Processing Dependency: lzma for package: man-1.6f-39.el6.x86_64
--> Running transaction check
---> Package xz-lzma-compat.x86_64 0:4.999.9-0.5.beta.20091007git.el6 will be installed
--> Processing Dependency: xz = 4.999.9-0.5.beta.20091007git.el6 for package: xz-lzma-compat-4.999.9-0.5.beta.20091007git.el6.x86_64
--> Running transaction check
---> Package xz.x86_64 0:4.999.9-0.5.beta.20091007git.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================
 Package               Arch          Version                                 Repository    Size
================================================================================================
Installing:
 man                   x86_64        1.6f-39.el6                             local        265 k
Installing for dependencies:
 xz                    x86_64        4.999.9-0.5.beta.20091007git.el6        local        137 k
 xz-lzma-compat        x86_64        4.999.9-0.5.beta.20091007git.el6        local         16 k

Transaction Summary
================================================================================================
Install       3 Package(s)

Total download size: 418 k
Installed size: 887 k
Is this ok [y/N]: y
Downloading Packages:
------------------------------------------------------------------------------------------------
Total                                                           148 MB/s | 418 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : xz-4.999.9-0.5.beta.20091007git.el6.x86_64                                   1/3
  Installing : xz-lzma-compat-4.999.9-0.5.beta.20091007git.el6.x86_64                       2/3
  Installing : man-1.6f-39.el6.x86_64                                                       3/3
  Verifying  : xz-lzma-compat-4.999.9-0.5.beta.20091007git.el6.x86_64                       1/3
  Verifying  : man-1.6f-39.el6.x86_64                                                       2/3
  Verifying  : xz-4.999.9-0.5.beta.20091007git.el6.x86_64                                   3/3

Installed:
  man.x86_64 0:1.6f-39.el6

Dependency Installed:
  xz.x86_64 0:4.999.9-0.5.beta.20091007git.el6
  xz-lzma-compat.x86_64 0:4.999.9-0.5.beta.20091007git.el6

Complete!

-확인(which 는 실행 파일 경로를 알려준다.)

[root@systemeng ~]# which man
/usr/bin/man
[root@systemeng ~]# man 명령어
정상적으로 출력된다.



반응형
반응형

[Linux Setting] CentOS 6.9 Setting Guide : 패키지 관리: yum group 확인

1. 용도 및 목적

Linux 설치 및 다양한 테스트 환경을 만들기 위함, 설치 패키지에 관련되어 좀더 효율적인 방안을 찾기위해 초기 설치 때 설치와 비교 하도록 한다. OS image 마운트 및 yum local 설정이 되있는 상태이다.

2. 설치 환경

-O/S

 Windows 10 Pro , VirtualBox(CentOS6.9)

-H/W

 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz

 RAM 8GB

 SDD 256GB

3. 확인

-우리는 minimal 설치를 진행하였고, 몇개의 그룹패키지가 설치 되었는지 확인해본다. 설치된것이 거의 없다. 

[root@systemeng ~]# yum grouplist
Loaded plugins: fastestmirror
Setting up Group Process
Loading mirror speeds from cached hostfile
Installed Groups:  #설치된 패키지 (뭐 없음)
   E-mail server
   Security Tools
Available Groups: #설치 가능한 패키지 그룹
   Additional Development
   Backup Client
   Backup Server
   Base
   CIFS file server
   Client management tools
   Compatibility libraries
   Console internet tools
   Debugging Tools
   Desktop
   Desktop Debugging and Performance Tools
   Desktop Platform
   Desktop Platform Development
   Development tools
   Dial-up Networking Support
   Directory Client
   Directory Server
   Eclipse
   Emacs
   FCoE Storage Client
   FTP server
   Fonts
   General Purpose Desktop
   Graphical Administration Tools
   Graphics Creation Tools
   Guest Agents
   Hardware monitoring utilities
   High Availability
   High Availability Management
   Identity Management Server
   Infiniband Support
   Input Methods
   Internet Applications
   Internet Browser
   Java Platform
   KDE Desktop
   Large Systems Performance
   Legacy UNIX compatibility
   Legacy X Window System compatibility
   Load Balancer
   Mainframe Access
   Messaging Client Support
   MySQL Database client
   MySQL Database server
   NFS file server
   Network Infrastructure Server
   Network Storage Server
   Network file system client
   Networking Tools
   Office Suite and Productivity
   PHP Support
   Performance Tools
   Perl Support
   PostgreSQL Database client
   PostgreSQL Database server
   Print Server
   Printing client
   Remote Desktop Clients
   Resilient Storage
   Ruby Support
   SNMP Support
   Scalable Filesystems
   Scientific support
   Server Platform
   Server Platform Development
   Smart card support
   Storage Availability Tools
   System Management
   System administration tools
   TeX support
   Technical Writing
   TurboGears application framework
   Virtualization
   Virtualization Client
   Virtualization Platform
   Virtualization Tools
   Web Server
   Web Servlet Engine
   Web-Based Enterprise Management
   X Window System
   iSCSI Storage Client
Available Language Groups:
   Afrikaans Support [af]
   Albanian Support [sq]
   Amazigh Support [ber]
   Arabic Support [ar]
   Armenian Support [hy]
   Assamese Support [as]
   Azerbaijani Support [az]
   Basque Support [eu]
   Belarusian Support [be]
   Bengali Support [bn]
   Bhutanese Support [dz]
   Brazilian Portuguese Support [pt_BR]
   Breton Support [br]
   Bulgarian Support [bg]
   Catalan Support [ca]
   Chhattisgarhi Support [hne]
   Chichewa Support [ny]
   Chinese Support [zh]
   Coptic Support [cop]
   Croatian Support [hr]
   Czech Support [cs]
   Danish Support [da]
   Dutch Support [nl]
   English (UK) Support [en_GB]
   Esperanto Support [eo]
   Estonian Support [et]
   Ethiopic Support [am]
   Faroese Support [fo]
   Fijian Support [fj]
   Filipino Support [fil]
   Finnish Support [fi]
   French Support [fr]
   Frisian Support [fy]
   Friulian Support [fur]
   Gaelic Support [gd]
   Galician Support [gl]
   Georgian Support [ka]
   German Support [de]
   Greek Support [el]
   Gujarati Support [gu]
   Hebrew Support [he]
   Hiligaynon Support [hil]
   Hindi Support [hi]
   Hungarian Support [hu]
   Icelandic Support [is]
   Indonesian Support [id]
   Interlingua Support [ia]
   Inuktitut Support [iu]
   Irish Support [ga]
   Italian Support [it]
   Japanese Support [ja]
   Kannada Support [kn]
   Kashmiri Support [ks]
   Kashubian Support [csb]
   Kazakh Support [kk]
   Khmer Support [km]
   Kinyarwanda Support [rw]
   Konkani Support [kok]
   Korean Support [ko]
   Kurdish Support [ku]
   Lao Support [lo]
   Latin Support [la]
   Latvian Support [lv]
   Lithuanian Support [lt]
   Low Saxon Support [nds]
   Luxembourgish Support [lb]
   Macedonian Support [mk]
   Maithili Support [mai]
   Malagasy Support [mg]
   Malay Support [ms]
   Malayalam Support [ml]
   Maltese Support [mt]
   Manx Support [gv]
   Maori Support [mi]
   Marathi Support [mr]
   Mongolian Support [mn]
   Myanmar (Burmese) Support [my]
   Nepali Support [ne]
   Northern Sotho Support [nso]
   Norwegian Support [nb]
   Occitan Support [oc]
   Oriya Support [or]
   Persian Support [fa]
   Polish Support [pl]
   Portuguese Support [pt]
   Punjabi Support [pa]
   Romanian Support [ro]
   Russian Support [ru]
   Sanskrit Support [sa]
   Sardinian Support [sc]
   Serbian Support [sr]
   Sindhi Support [sd]
   Sinhala Support [si]
   Slovak Support [sk]
   Slovenian Support [sl]
   Somali Support [so]
   Southern Ndebele Support [nr]
   Southern Sotho Support [st]
   Spanish Support [es]
   Swahili Support [sw]
   Swati Support [ss]
   Swedish Support [sv]
   Tagalog Support [tl]
   Tajik Support [tg]
   Tamil Support [ta]
   Telugu Support [te]
   Tetum Support [tet]
   Thai Support [th]
   Tibetan Support [bo]
   Tsonga Support [ts]
   Tswana Support [tn]
   Turkish Support [tr]
   Turkmen Support [tk]
   Ukrainian Support [uk]
   Upper Sorbian Support [hsb]
   Urdu Support [ur]
   Uzbek Support [uz]
   Venda Support [ve]
   Vietnamese Support [vi]
   Walloon Support [wa]
   Welsh Support [cy]
   Xhosa Support [xh]
   Zulu Support [zu]
Done

-그룹에 포함된 패키지 확인

[root@systemeng ~]# yum groupinfo "X Window System"
Loaded plugins: fastestmirror
Setting up Group Process
Loading mirror speeds from cached hostfile

Group: X Window System
 Description: X Window System Support.
 Mandatory Packages:
   xorg-x11-drivers
   xorg-x11-server-Xorg
   xorg-x11-xauth
   xorg-x11-xinit
 Default Packages:
   firstboot
   glx-utils
   hal
   plymouth-system-theme
   spice-vdagent
   wacomexpresskeys
   wdaemon
   xorg-x11-server-utils
   xorg-x11-utils
   xvattr
 Optional Packages:
   xcb-util-image
   xcb-util-keysyms
   xcb-util-wm

-실제 OS 설치 할때의 패키지 모습과 위에 grouplist 와 group명을 한번씩 찾아 비교해보면 도움이 된다. 

(참고)minimal -> Customize now 로 확인했기 때문에 거의 모든 항목에 체크박스가 풀려있다. 

 

확인 완료



반응형
반응형

[Linux Setting] CentOS 6.9 Setting Guide : 패키지 관리: yum 설정

1. 용도 및 목적

Linux 설치 및 다양한 테스트 환경을 만들기 위함, 이부분은 꽤 중요하다.대부분 현장에서 패키지를 온라인 저장소에서 받질 못하기에 우리처럼 minimal로 설치 된 서버라면 OS 이미지 마운트 후에 필요한 패키지를 설치해야한다. 그런데!! 문제는 리눅스는 의존성 덩어리라 rpm 한개 한개 설치 하려고 하면 솔직히 거의 불가능에 가까워진다. 이때 사용하는 것이 yum이라고 간단하게 이해하면 된다. 

2. 설치 환경

-O/S

 Windows 10 Pro , VirtualBox(CentOS6.9)

-H/W

 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz

 RAM 8GB

 SDD 256GB

3. 진행

-CentOS6.9 mount 

# mount /dev/sr0 /media/dvdrom/

mount: block device /dev/sr0 is write-protected, mounting read-only

-mount 상태 확인

[root@systemeng ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                       35G  700M   33G   3% /
tmpfs                 939M     0  939M   0% /dev/shm
/dev/sda1             477M   40M  413M   9% /boot
/dev/sr0              3.7G  3.7G     0 100% /media/dvdrom

-yum repository 설정 - 기본 저장소 백업

# cd /etc/yum.repos.d/
# ls
CentOS-Base.repo       CentOS-fasttrack.repo  CentOS-Vault.repo
CentOS-Debuginfo.repo  CentOS-Media.repo
# mkdir repobackup
# mv * repobackup/
# ls
repobackup

-현재 패키지가 0임을 확인

# yum repolist
Loaded plugins: fastestmirror
repolist: 0

-local repository 생성

# vi /etc/yum.repos.d/local.repo
[local]
name=local
baseurl=file:///media/dvdrom
gpgcheck=0
enabled=1

-현재 패키지 다시 확인

# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
local                                                              | 4.0 kB     00:00 ...
local/primary_db                                                   | 4.7 MB     00:00 ...
repo id                                    repo name                                status
local                                      local                                    6,706
repolist: 6,706

완료



반응형
반응형

[Linux Setting] CentOS 6.9 Setting Guide : 패키지 관리: OS image mount

1. 용도 및 목적

Linux 설치 및 다양한 테스트 환경을 만들기 위함, OS 기본 설치 후 솔루션 또는 별도 S/W 설치에 기본적인 리눅스 패키지들이 필요하게 된다. 우리는 최소로 설치 했기 때문에 어지간한 패키지가 거의 없을것이고, 필요에 따라 설치 할수 있도록 준비하도록 한다. (OS 이미지가 아니고 RPM 패키지만 받아서 구워갔어도 아래와 같이 진행한다.)

2. 설치 환경

-O/S

 Windows 10 Pro , VirtualBox(CentOS6.9)

-H/W

 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz

 RAM 8GB

 SDD 256GB

3. 진행

-실행 중인 가상머신(CentOS6 A) -> 장치 -> 광학 드라이브 -> 디스크 이미지 선택 클릭

-이전에 받은 DVD1 열기

-putty 로 CentOS6 A 접속 

-현재 디스크 볼륨 상태

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                       35G  700M   33G   3% /
tmpfs                 939M     0  939M   0% /dev/shm
/dev/sda1             477M   40M  413M   9% /boot

-OS 이미지를 마운트할 디렉토리 생성

# mkdir /media/dvdrom

-방금 생성한 디렉토리에 OS 이미지 마운트(/dev/sr0 이 DVD)

#mount /dev/sr0 /media/dvdrom/
mount: block device /dev/sr0 is write-protected, mounting read-only 

-OS 이미지 마운트 후 볼륨 상태

#df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                       35G  700M   33G   3% /
tmpfs                 939M     0  939M   0% /dev/shm
/dev/sda1             477M   40M  413M   9% /boot
/dev/sr0              3.7G  3.7G     0 100% /media/dvdrom

-중요 항상 임시 저장소는 다 사용한뒤 umount 해야함

# umount /media/dvdrom

# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/VolGroup-lv_root

                       35G  725M   33G   3% /

tmpfs                 939M     0  939M   0% /dev/shm

/dev/sda1             477M   40M  413M   9% /boot


마운트 완료






반응형
반응형

[Linux Setting] CentOS 6.9 Setting Guide : 기본설정 : kdump 설정

1. 용도 및 목적

Linux 설치 및 다양한 테스트 환경을 만들기 위함

kernel dump 를 받기 위해 설정한다. (OS 접근불가, HANG 으로  로그 수집이 불가능 할대 로컬에서  dump 다운하여 직접 분석 또는 sosreport로 분석 불가시 추가로 필요함, 긴급 재기동 후에는 이미 받을 수가 없으므로, 미리 설정하여 긴급 복구시 먼저 dump를 확보한다.)

2. 설치 환경

-O/S

 Windows 10 Pro , VirtualBox(CentOS6.9)

-H/W

 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz

 RAM 8GB

 SDD 256GB

3. 설정

-kdump 서비스 확인(minimal 설치시 활성화 되어있음)

# service kdump status

Kdump is operational

# chkconfig --list kdump

kdump           0:off   1:off   2:off   3:on    4:on    5:on    6:off

-sysrq 활성화

#vi /etc/sysctl.conf
#아래 설정 0에서 1로 변경
kernel.sysrq = 1

#즉시 적용(임시적용 방법도 있으나, 설정을 미리 안해두면 HANG 상태에서, 로컬 또는 원격으로 명령어를 칠수 있는 방법이 없으므로 큰 의미가 없음)
#sysctl -p /etc/sysctl.conf
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 1
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296

-dump (vmcore) 생성 위치 확인

#vi /etc/kdump.conf
#path 확인(리얼서버에서는 미리 공간확보를 위해 OS 설치 시 별도 파티션으로 메모리용량 보다 좀 더 크게 확보해두기도한다.)
path /var/crash

-dump 생성(옵션이 여러개이지만, c 옵션을 주로 씀, path 위치에 파일로 생성함, H/W 장애와 겹칠시 안먹는 경우도 있음)

로컬(서버앞)에서 키보드로 alt+SysRq(PrintScreen)+c

설정된 path에 아래와 같이 vmcore가 생성되며 서버는 재기동된다.
메모리상에 돌아가는것도 없어서 사실상 용량이 얼마 안된다.

[root@systemeng 127.0.0.1-2018-07-03-16:34:24]# pwd
/var/crash/127.0.0.1-2018-07-03-16:34:24
[root@systemeng 127.0.0.1-2018-07-03-16:34:24]# ls -alh
total 24M
drwxr-xr-x. 2 root root 4.0K Jul  3 16:34 .
drwxr-xr-x. 4 root root 4.0K Jul  3 16:46 ..
-rw-------. 1 root root  24M Jul  3 16:34 vmcore
-rw-r--r--. 1 root root  27K Jul  3 16:34 vmcore-dmesg.txt




반응형
반응형

[Linux Setting] CentOS 6.9 Setting Guide : 기본설정 : hosts 설정

1. 용도 및 목적

Linux 설치 및 다양한 테스트 환경을 만들기 위함

단순하게 문자열로 IP 주소를 찾게 하기위한 주소록이라볼수 있는 hosts 등록

2. 설치 환경

-O/S

 Windows 10 Pro , VirtualBox(CentOS6.9)

-H/W

 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz

 RAM 8GB

 SDD 256GB

3. hosts 등록 방법

서버 세팅을 진행하면서, 본인이 세팅하고자하는 서버가 2대 이상인 경우가 생길수 있다. 

이때 각서버의 IP 문자열로 구분하여 설정할 때 사용된다. 실제로 소프트웨어에서 hosts 등록된 이름으로 하드코딩 되었을때 장비 IP 변경시 단순하게 hosts 파일만 변경하여 적용 할수 있는 이점도 있다. 

-hosts 등록 방법

#vi /etc/hosts

[root@systemeng /]# vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.35.10 centos5

192.168.35.11 centos6

192.168.35.12 centos7

-hosts 테스트(실제 세팅된 centos6 만 ping 되긴 하지만, 세팅된 hosts로 ip 가 ping 시도를 하는 것을 확인할수 있다.)

[root@systemeng /]# ping centos5

PING centos5 (192.168.35.10) 56(84) bytes of data.

^C

--- centos5 ping statistics ---

3 packets transmitted, 0 received, 100% packet loss, time 2015ms


[root@systemeng /]# ping centos6

PING centos6 (192.168.35.11) 56(84) bytes of data.

64 bytes from centos6 (192.168.35.11): icmp_seq=1 ttl=64 time=0.008 ms

64 bytes from centos6 (192.168.35.11): icmp_seq=2 ttl=64 time=0.015 ms

64 bytes from centos6 (192.168.35.11): icmp_seq=3 ttl=64 time=0.014 ms

^C

--- centos6 ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 2503ms

rtt min/avg/max/mdev = 0.008/0.012/0.015/0.004 ms

[root@systemeng /]# ping centos7

PING centos7 (192.168.35.12) 56(84) bytes of data.

^C

--- centos7 ping statistics ---

3 packets transmitted, 0 received, 100% packet loss, time 2479ms


-다중 등록(centos6에 systemeng 추가)

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6


192.168.35.10 centos5

192.168.35.11 centos6 systemeng

192.168.35.12 centos7


-다중 등록 테스트(이 부분 주의, 특정 kernel version과 특정 솔루션의 조합에 문제 있을경우 OS 자체에 문제가 생겼었다. 아쉽지만 이부분은 정확한 원인을 알수 없었다.되도록이면 불필요한 다중 등록은 추가하지 말도록 한다.)

[root@systemeng /]# ping systemeng

PING centos6 (192.168.35.11) 56(84) bytes of data.

64 bytes from centos6 (192.168.35.11): icmp_seq=1 ttl=64 time=0.008 ms

64 bytes from centos6 (192.168.35.11): icmp_seq=2 ttl=64 time=0.015 ms

64 bytes from centos6 (192.168.35.11): icmp_seq=3 ttl=64 time=0.015 ms






반응형
반응형

[Linux Setting] CentOS 6.9 Setting Guide : 기본설정 : selinux, iptables 설정 변경(OFF)

1. 용도 및 목적

Linux 설치 및 다양한 테스트 환경을 만들기 위함. 보안 관련 내용 OFF 후 따로 내용 다룰 예정, selinux는 대부분 사용안하지만 iptables는  활용을 많이 하므로 배워두는 것이 좋음

참고 : 현장에서 초기에 상단 네트워크(방화벽) 작업이나 보안 작업 시 저 두개 켜놓고 다른 사람들이 모르면 원인 찾다가 시간 다갑니다.

2. 설치 환경

-O/S

 Windows 10 Pro , VirtualBox(CentOS6.9)

-H/W

 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz

 RAM 8GB

 SDD 256GB

3. selinux 설정 변경 진행

-selinux 현재 상태

#getenforce
Enforceing, Permissive 면 활성화 상태

-selinux disabled (서버 재기동 필요 : reboot)

#vi /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
#SELINUX=enforcing
SELINUX=disabled    #이 부분 변경
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

4. iptables 설정 변경 진행

-iptables 현재 상태

# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
2    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0
3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
5    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
1    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

-iptables stop(재기동 필요없음)

#service iptables stop
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]

-iptables 기동 설정 변경(runlevel 2,3,4,5 에 활성화 전부 OFF 진행)

#chkconfig --list iptables
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
#chkconfig iptables off
#chkconfig --list iptables
iptables        0:off   1:off   2:off   3:off   4:off   5:off   6:off




반응형
반응형

[Linux Setting] CentOS 6.9 Setting Guide : 기본설정 : hostname 설정

1. 용도 및 목적

Linux 설치 및 다양한 테스트 환경을 만들기 위함

2. 설치 환경

-O/S

 Windows 10 Pro , VirtualBox(CentOS6.9)

-H/W

 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz

 RAM 8GB

 SDD 256GB

3.호스트네임 변경

-임시 적용(재기동 시 초기화)

#hostname systemeng 

-영구 적

vi /etc/sysconfig/network
NETWORKING=yes
#HOSTNAME=localhost.localdomain
HOSTNAME=systemeng

-재기동 후 아래 화면







반응형
반응형

[Linux Setting] CentOS 6.9 Setting Guide : 기본설정 : 네트워크 설정(bonding)

1. 용도 및 목적

Linux 설치 및 다양한 테스트 환경을 만들기 위함

네트워크 이중화 및 연결을 위한 NIC Setting 및 테스트

2. 설치 환경

-O/S

 Windows 10 Pro , VirtualBox(CentOS6.9)

-H/W

 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz

 RAM 8GB

 SDD 256GB

3. 로그 인 후 아래 절차를 따른다.

-root로 로그인한다

ID : root, PW : 기존에설정한PW

4. 네트워크 이중화 구성 (NIC 설정)

인터페이스 bond0 생성 (fail_over_mac=1 옵션은 리얼장비에서 보통 안쓰나, Virtualbox 에서 저 옵션을 안하면 인터페이스 절체가 안된다, 추측으로는 실제 스위치가 아닌 가상머신의 네트워크 어댑터 문제로 보인다)

-bond0 인터페이스 생성

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0
IPADDR=192.168.35.11
PREFIX=24
ONBOOT=yes
BOOTPROTO=none
BONDING_OPTS="mode=1 miimon=100 fail_over_mac=1" 

GATEWAY=192.168.35.1

-bond0 에 eth0 멤버 추가

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:AB:3F:36
TYPE=Ethernet
UUID=e76a3e8d-9274-4360-aec6-2f21d53a862b
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes

-bond0 에 eth1 멤버 추가

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=08:00:27:E6:5B:1D
TYPE=Ethernet
UUID=8cc4944b-d06d-4b38-92a8-0581f8c44e60
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes

-bond0 상태 확인

[root@localhost ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ab:3f:36
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:e6:5b:1d
Slave queue ID: 0


-network 재시작

#service network restart

4.interface failover 테스트

-현재 상태확인(Active : eth0)

[root@localhost ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ab:3f:36
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:e6:5b:1d
Slave queue ID: 0

-수동으로 eth0을 다운시킨다.

[root@localhost ~]# ifdown eth0

-절체 후 상태확인(Active : eth1)

[root@localhost ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:e6:5b:1d
Slave queue ID: 0



반응형

+ Recent posts