목차 |
---|
개요
OS | 디렉터리 | 파일 | 네트워크 재설정 명령 | 비고 |
---|---|---|---|---|
RHEL7, 8 | /etc/sysconfig/network-scripts | ifcfg-eno1 | systemctl restart network | |
RHEL9 | /etc/NetworkManager/system-connections | eno1.nmconnection | systemctl restart NetworkManager | 설정 디렉터리 내 내용 전부 지우면 network-scripts 로 동작함 |
Ubuntu 16 | /etc/network | interfaces | systemctl restart network | |
Ubuntu | /etc/netplan | 50-cloud-init.yaml | netplan apply |
...
코드 블럭 | ||||||
---|---|---|---|---|---|---|
| ||||||
TYPE=Ethernet MTU=9000 NAME=eno1 DEVICE=eno1 ONBOOT=yes # DHCP 인 경우 BOOTPROTO=dhcp # 고정IP 인 경우 # BOOTPROTO : none 또는 static # NETMASK, PREFIX 중 하나를 설정 BOOTPROTO=static IPADDR=192.168.0.1 NETMASK=255.255.255.0 PREFIX=24 GATEWAY=172.16.10.1 # DNS DNS1=134.75.30.1 DNS2=8.8.8.8 DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_DISABLED=no IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no # 방화벽 존 ZONE=public |
IPv6 예제
코드 블럭 | ||||
---|---|---|---|---|
| ||||
TYPE=Ethernet
MTU=9000
NAME=eno1
DEVICE=eno1
ONBOOT=yes
# DHCP 인 경우
BOOTPROTO=dhcp
# 고정IP 인 경우
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_FORCE_ACCEPT_RA=no
IPV6ADDR=fc00:320:11:248::10/64
IPV6_DEFAULTGW=fc00:320:11:248::1
DNS1=2001:4860:4860::8888 |
network-scripts deprecatednetwork-scripts deprecated
코드 블럭 |
---|
# cat /etc/sysconfig/network-scripts/readme-ifcfg-rh.txt NetworkManager stores new network profiles in keyfile format in the /etc/NetworkManager/system-connections/ directory. Previously, NetworkManager stored network profiles in ifcfg format in this directory (/etc/sysconfig/network-scripts/). However, the ifcfg format is deprecated. By default, NetworkManager no longer creates new profiles in this format. Connection profiles in keyfile format have many benefits. For example, this format is INI file-based and can easily be parsed and generated. ... |
...
코드 블럭 | ||||
---|---|---|---|---|
| ||||
network: ethernets: # Network A - Default Route eno1: mtu: 9000 dhcp4: false addresses: - 172.16.0.20/24 gateway4: 172.16.0.1 nameservers: addresses: [8.8.8.8, 8.8.4.4] # Network B eno2: mtu: 9000 dhcp4: false addresses: - 192.168.0.10/24 # gateway4: 192.168.0.1 # important - disable default gateway for Network B routes: # route for internal (if needed) - to: 192.168.0.10/24 via: 192.168.0.1 metric: 0 # Network B eno3: dhcp4: true dhcp4-overrides: use-routes: false routes: - to: 192.168.100.0/24 via: 192.168.100.1 metric: 0 version: 2 |
interfaces 예제
...