jsg@jsg-ubuntu:~$ nmcli g STATE CONNECTIVITY WIFI-HW WIFI WWAN-HW WWAN connected full enabled enabled enabled enabled
jsg@jsg-ubuntu:~$ nmcli n enabled
jsg@jsg-ubuntu:~$ nmcli n enabled jsg@jsg-ubuntu:~$ nmcli n off jsg@jsg-ubuntu:~$ nmcli n disabled jsg@jsg-ubuntu:~$ nmcli n on jsg@jsg-ubuntu:~$ nmcli n enabled
jsg@jsg-ubuntu:~$ nmcli d DEVICE TYPE STATE CONNECTION ens33 ethernet connected 유선 연결 1 lo loopback unmanaged --
$ nmcli c s
: connection에 대한 정보 출력jsg@jsg-ubuntu:~$ nmcli c NAME UUID TYPE DEVICE 유선 연결 1 e5d2e63d-d532-3476-94c8-4dae9b2d6e03 802-3-ethernet ens33
$ nmcli c s device_name
: 특정 디바이스에 대한 상세 정보jsg@jsg-ubuntu:~$ nmcli c s '유선 연결 1' connection.id: 유선 연결 1 connection.uuid: e5d2e63d-d532-3476-94c8-4dae9b2d6e03 connection.interface-name: -- ... GENERAL.NAME: 유선 연결 1 GENERAL.UUID: e5d2e63d-d532-3476-94c8-4dae9b2d6e03 GENERAL.DEVICES: ens33 ...
=> 소문자로 적힌것들은 설정한 값, offline일 때도 보임
=> 대문자로 적힌것들은 실행된 값, online일 때만 보임
$ nmcli c down device_name
: 연결 끊기jsg@jsg-ubuntu:~$ nmcli c down '유선 연결 1' Connection '유선 연결 1' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1) jsg@jsg-ubuntu:~$ nmcli c s '유선 연결 1' connection.id: 유선 연결 1 connection.uuid: e5d2e63d-d532-3476-94c8-4dae9b2d6e03 connection.interface-name: -- connection.type: 802-3-ethernet connection.autoconnect: yes ... # 대문자인 값들이 나오지 않음
$ nmcli c up device_name
: 연결jsg@jsg-ubuntu:~$ nmcli c up '유선 연결 1' Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2) jsg@jsg-ubuntu:~$ nmcli c s '유선 연결 1' connection.id: 유선 연결 1 connection.uuid: e5d2e63d-d532-3476-94c8-4dae9b2d6e03 connection.interface-name: -- connection.type: 802-3-ethernet ... GENERAL.NAME: 유선 연결 1 GENERAL.UUID: e5d2e63d-d532-3476-94c8-4dae9b2d6e03 GENERAL.DEVICES: ens33 GENERAL.STATE: activated ...
속성 | 설명 | 속성 | 설명 | |
---|---|---|---|---|
ipv4.method | auto : dhcp manual : static ip | ipv4.gateway | Gateway ip | |
ipv4.addr | CIDR 표기법 ex) 192.168.110.50/24 | ipv4.dns | DNS 서버 ip |
$ nmcli c mod device_name [+/-]property value
: +는 추가, -는 제거, 기본은 덮어쓰기jsg@jsg-ubuntu:~$ nmcli c mod '유선 연결 1' connection.id ens33 jsg@jsg-ubuntu:~$ nmcli c NAME UUID TYPE DEVICE ens33 e5d2e63d-d532-3476-94c8-4dae9b2d6e03 802-3-ethernet ens33
jsg@jsg-ubuntu:~$ nmcli c mod ens33 ipv4.method manual\ ipv4.addresses 192.168.61.110/24ipv4.gateway 192.168.61.2 ipv4.dns 8.8.8.8 # 설정 후 up 을 해줘야 변경이 완료됨 jsg@jsg-ubuntu:~$ nmcli c down ens33 && nmcli c up ens33 Connection 'ens33' successfully deactivated Connection successfully activated jsg@jsg-ubuntu:~$ nmcli c s ens33 connection.id: ens33 ... ipv4.method: manual ipv4.dns: 8.8.8.8 ipv4.dns-search: ipv4.dns-options: (default) ipv4.dns-priority: 0 ipv4.addresses: 192.168.61.110/24 ipv4.gateway: 192.168.61.2 ... IP4.ADDRESS[1]: 192.168.61.110/24 IP4.GATEWAY: 192.168.61.2 IP4.ROUTE[1]: dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000 IP4.DNS[1]: 8.8.8.8 IP6.ADDRESS[1]: fe80::2c41:76d8:72aa:d826/64 IP6.GATEWAY:
$ nmcli c del device_name
jsg@jsg-ubuntu:~$ nmcli c del ens33 Connection 'ens33' (e5d2e63d-d532-3476-94c8-4dae9b2d6e03) successfully deleted.
$ nmcli c add con-name ens33 ifname ens33 type ethernet ip4 ip
jsg@jsg-ubuntu:~$ nmcli c add con-name ens33 ifname ens33 type ethernet \ ip4 192.168.61.110/24 Connection 'ens33' (f8e0882f-452d-4fc4-a11c-03dfa7e818e8) successfully added jsg@jsg-ubuntu:~$ nmcli c mod ens33 +ipv4.dns 8.8.8.8 jsg@jsg-ubuntu:~$ nmcli connection mod ens33 ipv4.gateway 192.168.61.2
$ nmcli dev connect ens33
를 하고 다시 해보자