๊ฐœ์š”

OS๋””๋ ‰ํ„ฐ๋ฆฌํŒŒ์ผ๋„คํŠธ์›Œํฌ ์žฌ์„ค์ • ๋ช…๋ น๋น„๊ณ 

RHEL 7, 8

/etc/sysconfig/network-scriptsifcfg-eno1systemctl restart network
RHEL 9, 10/etc/NetworkManager/system-connectionseno1.nmconnectionsystemctl restart NetworkManager์„ค์ • ๋””๋ ‰ํ„ฐ๋ฆฌ ๋‚ด ๋‚ด์šฉ ์ „๋ถ€ ์ง€์šฐ๋ฉด network-scripts ๋กœ ๋™์ž‘ํ•จ
Ubuntu 16/etc/networkinterfacessystemctl restart network
Ubuntu 18~/etc/netplanxxx.yaml, xxx.ymlnetplan apply


nmtui

OS ๋ฌด๊ด€ํ•˜๊ฒŒ ํ„ฐ๋ฏธ๋„์—์„œ ์‚ฌ์šฉ๊ฐ€๋Šฅํ•œ ๋ช…๋ น์–ด


network-scripts ์˜ˆ์ œ (ifcfg ํ˜•์‹)

BASH ํ˜•์‹

ifcfg-eno1
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 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.

...


NetworkManager ์˜ˆ์ œ (ini ํ˜•์‹)

eno1.nmconnection
[connection]
id=eno1
interface-name=eno1
type=ethernet
autoconnect=false

[ethernet]
mtu=9000

[ipv4]
; DHCP ์ธ ๊ฒฝ์šฐ
method=auto

;๊ณ ์ • IP ์ธ ๊ฒฝ์šฐ
method=manual
address1=192.168.16.240/24,192.168.16.1
dns=134.75.30.1;

[ipv6]
addr-gen-mode=eui64
method=auto

[proxy]


netplan ํ˜•์‹ (yaml ํ˜•์‹)

ํ•˜๊ธฐ ๋ฌธ์„œ์—์„œ Examples ์ฐธ๊ณ 
https://manpages.ubuntu.com/manpages/jammy/man5/netplan.5.html

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 ์˜ˆ์ œ

https://wiki.debian.org/NetworkConfiguration

/etc/network/interfaces
source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens160
iface ens160 inet static
	address 192.168.100.1
	netmask 255.255.255.128
	network 192.168.100.0
	gateway 192.168.100.1
	dns-nameservers 134.75.30.1



  • ๋ ˆ์ด๋ธ” ์—†์Œ