버전 비교

  • 이 줄이 추가되었습니다.
  • 이 줄이 삭제되었습니다.
  • 서식이 변경되었습니다.

...

OS디렉터리파일네트워크 재설정 명령

RHEL7, 8

/etc/sysconfig/network-scriptsifcfg-eno1systemctl restart network
RHEL9/etc/NetworkManager/system-connectionseno1.nmconnectionsystemctl restart NetworkManager
Ubuntu 16/etc/networkinterfacessystemctl restart network
Ubuntu/etc/netplan50-cloud-init.yamlnetplan apply


nmtui

OS 무관하게 터미널에서 사용가능한 명령어

...

코드 블럭
languagetext
titleeno1.nmconnection
linenumberstrue
[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

코드 블럭
languageyml
linenumberstrue
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
  version: 2


interfaces 예제

https://wiki.debian.org/NetworkConfiguration

코드 블럭
title/etc/network/interfaces
linenumberstrue
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