1. 버전
– Rocky-9.2
2. 설명
2-1. nmcli 란?
NetworkManager와 상호 작용할 수 있도록 하는 명령어 도구입니다.
3. nmcli
3-1. 네트워크 디바이스 확인
# nmcli device
DEVICE TYPE STATE CONNECTION
ens32 ethernet connected ens32
lo loopback connected (externally) lo
3-2. 고정 IP 설정
# nmcli connection modify ens32 ipv4.addresses 192.168.204.221/24
# nmcli connection modify ens32 ipv4.gateway 192.168.204.254
# nmcli connection modify ens32 ipv4.dns 168.126.63.1
# nmcli connection modify ens32 ipv4.method manual
# nmcli connection up ens32
3-3. 고정 IP 설정 확인
# nmcli connection show ens32 | grep ipv4
ipv4.method: manual
ipv4.dns: 168.126.63.1
ipv4.addresses: 192.168.204.221/24
ipv4.gateway: 192.168.204.254
# ifconfig
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.204.221 netmask 255.255.255.0 broadcast 192.168.204.255
inet6 fe80::250:56ff:fead:14b0 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:ad:14:b0 txqueuelen 1000 (Ethernet)
RX packets 3120 bytes 208890 (203.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 167 bytes 27215 (26.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 72 bytes 6120 (5.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 72 bytes 6120 (5.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
# ping google.com
64 bytes from kix06s11-in-f14.1e100.net (142.250.207.110): icmp_seq=1 ttl=55 time=77.0 ms
64 bytes from kix06s11-in-f14.1e100.net (142.250.207.110): icmp_seq=2 ttl=55 time=77.1 ms
64 bytes from kix06s11-in-f14.1e100.net (142.250.207.110): icmp_seq=3 ttl=55 time=77.1 ms