«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Tags more
Archives
Today
Total
12-27 09:19
관리 메뉴

+1-1+1-1+1-1+1-1...

리눅스 서버 기본 세팅 > 네트워크 환경 설정 - RHPL 7.3 본문

Linux/Sever Mangement

리눅스 서버 기본 세팅 > 네트워크 환경 설정 - RHPL 7.3

투명인간 2021. 1. 12. 11:09
728x90

1. 인터페이스 확인

>ip addr

1: lo: 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: enp0s8: mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:18:53:de brd ff:ff:ff:ff:ff:ff
inet 10.0.2.4/24 brd 10.0.2.255 scope global enp0s3
valid_lft forever preferred_lft forever
inet6 fe80::2e80:aad7:86da:450/64 scope link
valid_lft forever preferred_lft forever

 

2. 네트워크 설정 파일 경로 이동, 설정 파일 확인

> cd /etc/sysconfig/network-scripts/

> ls

ifcfg-enp0s8 ifdown-Team ifdown-ib ifdown-post ifdown-tunnel ifup-aliases ifup-ippp ifup-plusb
ifup-sit network-functions ifcfg-enp0s8 ifdown-TeamPort ifdown-ippp ifdown-ppp ifup ifup-bnep
ifup-ipv6 ifup-post ifup-tunnel network-functions-ipv6 ifcfg-lo ifdown-bnep ifdown-ipv6 ifdown-routes 
ifup-Team ifup-eth ifup-isdn ifup-ppp ifup-wireless ifdown ifdown-eth ifdown-isdn ifdown-sit 
ifup-TeamPort ifup-ib ifup-plip ifup-routes init.ipv6-global

 

3. 설정 파일 편집

> vi ifcfg-enp0s8

TYPE=Ethernet
BOOTPROTO=none  #DHCP 사용 안함
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
IPADDR=192.168.60.10
PREFIX=24 #서브넷 마스크
GATEWAY=192.168.60.1
DNS1=192.168.60.10
NAME=enp0s8
UUID=98bd522f-0be6-4521-bb31-97d0a2e9d832
DEVICE=enp0s8
ONBOOT=yes #부팅 후에도 적용

4. 네트워크 리스타트

> ifdown enp0s8
> ifup enp0s8

또는

>systemctl restart network

 

반응형