CentOS network 설정
테스트버전 CentOS 6.3
1) 네트워크 카드명 확인
[root@rfid ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:25:C0:D8
inet addr:192.168.0.71 Bcast:192.168.0.1 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe25:c0d8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:182 errors:0 dropped:0 overruns:0 frame:0
TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:16165 (15.7 KiB) TX bytes:6397 (6.2 KiB)
Interrupt:18 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[root@rfid ~]#
2) 네트위크 카드가 eth0인 경우
[root@rfid ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO=none
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE="Ethernet"
IPADDR=192.168.0.72
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
DNS1=192.168.0.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
---Cent OS 7.3
[root@YONA ~]#
[root@YONA ~]# nmtui ----->>GUI Mode
[root@YONA ~]# nmcli d
DEVICE TYPE STATE CONNECTION
ens160 ethernet connected ens160
lo loopback unmanaged --
[root@YONA ~]#
[root@YONA ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE="Ethernet"
BOOTPROTO="none"
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="ens160"
UUID="0000000000000000000000000000000000000000"
DEVICE="ens160"
ONBOOT="yes"
IPADDR="XXX.XXX.XXX.XXX"
PREFIX="27" -----> 255.255.255.224
GATEWAY="XXX.XXX.XXX"
DNS1=8.8.8.8
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_PRIVACY="no"
[root@YONA ~]#
3) 호스트명지정
[root@rfid ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
~
~
4) DNS지정
[root@rfid ~]# vi /etc/resolv.conf
nameserver 168.126.63.1
nameserver 168.126.63.2
5) 호스트명 우선순위 설정
[root@rfid ~]# vi /etc/host.conf
order hosts, bind <-- hosts 파일 선 검색 후 DNS 서버 검색
6) 수정내용 반영 서비스 재기동
[root@rfid ~]# service network restart
Shutting down interface eth0:
[ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: RTNETLINK answers: Invalid argument
Error adding default gateway 192.168.0.1 for eth0.
[ OK ]
[root@rfid ~]#
[root@rfid ~]#
텍스트모드로 각종 설정하기
네트워크설정, 방화벽 설정등
[root@dnsTEST ~]#
[root@dnsTEST ~]# setup
[root@dnsTEST ~]#
[root@dnsTEST ~]#
Text Mode Setup Utility 1.19.9 (c) 1999-2006 Red Hat, Inc.
┌────────┤ Choose a Tool ├─────────┐
│ │
│ Authentication configuration │
│ Firewall configuration │
│ Keyboard configuration │
│ Network configuration │
│ System services │
│ │
│ ┌──────────┐ ┌──────┐ │
│ │ Run Tool │ │ Quit │ │
│ └──────────┘ └──────┘ │
│ │
│ │
└──────────────────────────────────┘
'OS > Linux' 카테고리의 다른 글
ubuntu / usb인식 (0) | 2020.04.27 |
---|---|
파일 분할 및 압축관련 tar , tgz , gzip ,split (0) | 2020.04.27 |
설치된 package 확인 (0) | 2020.04.27 |
linux_runlevel변경 (0) | 2020.04.27 |
Download Oracle Java JRE & JDK using a script (0) | 2020.04.27 |