「CentOS 7/静的なIPアドレスを設定する」の版間の差分
imported>Administrator 編集の要約なし |
imported>Administrator 編集の要約なし |
||
| 8行目: | 8行目: | ||
$ nmcli connection modify eth0 ipv4.gateway 192.168.0.1 | $ nmcli connection modify eth0 ipv4.gateway 192.168.0.1 | ||
$ 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" | ||
ついでにOS起動時やLANケーブル結線時に自動的に接続を試みる設定もいれておく。 | |||
CentOS7はWindowsやMacと違い初期値は「自動接続しない」になってる。 | |||
$ nmcli connection modify eth0 connection.autoconnect yes | |||
この設定を入れても一度切断してから再接続しないと反映されない。 | この設定を入れても一度切断してから再接続しないと反映されない。 | ||