「CentOS 7/静的なIPアドレスを設定する」を編集中
この編集を取り消せます。 下記の差分を確認して、本当に取り消していいか検証してください。よろしければ変更を保存して取り消しを完了してください。
最新版 | 編集中の文章 | ||
2行目: | 2行目: | ||
$ nmcli connection modify eth0 ipv4.method manual ipv4.addresses 192.168.0.10/24 ipv4.gateway 192.168.0.1 ipv4.dns "8.8.8.8 8.8.4.4 192.168.0.1" | $ nmcli connection modify eth0 ipv4.method manual ipv4.addresses 192.168.0.10/24 ipv4.gateway 192.168.0.1 ipv4.dns "8.8.8.8 8.8.4.4 192.168.0.1" | ||
− | + | 上記は一行で書いてるが個別に書いてもよい。 | |
DNSのように複数の値を設定をする場合はダブルクオーテーションで囲み、半角スペースで区切る。 | DNSのように複数の値を設定をする場合はダブルクオーテーションで囲み、半角スペースで区切る。 | ||
$ nmcli connection modify eth0 ipv4.method manual | $ nmcli connection modify eth0 ipv4.method manual | ||
9行目: | 9行目: | ||
$ nmcli connection modify ipv4.dns "8.8.8.8 8.8.4.4 192.168.0.1" | $ nmcli connection modify ipv4.dns "8.8.8.8 8.8.4.4 192.168.0.1" | ||
− | + | この設定を入れても一度切断してから再接続しないと反映されない。 | |
− | |||
− | |||
− | |||
− | |||
$ nmcli connection down eth0 | $ nmcli connection down eth0 | ||
$ nmcli connection up eth0 | $ nmcli connection up eth0 |