0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

RockyLinux IPアドレス設定

Last updated at Posted at 2025-01-19

状況説明

VirtualBoxで開発環境を作る。
ホストはWindows11、ゲストはRokcyLinux 9.5 でゲストインストール済み。
接続方法は NAT Network (enp0s3) と hostonly (enp0s8)とする。
今回はコマンドラインでの設定に挑戦

現状確認

インストール直後の設定を確認

# ip a
# nmcli device status

NAT Network (enp0s3) の設定

// IPV4 アドレスを設定
# nmcli connection modify enp0s3 ipv4.address 10.0.2.13/24

// IPV4 メソッドをマニュアルに設定
# nmcli connection modify enp0s3 ipv4.method manual

// ゲートウェイを設定
# nmcli connection modify enp0s3 ipv4.gateway 10.0.2.1

// 接続設定を自動に設定
# nmcli connection modify enp0s3 connection.autoconnect yes

// IPv6を使わない
# nmcli connection modify enp0s3 ipv6.method disabled

// DNSを設定する
# nmcli connection modify enp0s3 ipv4.dns 10.0.2.1

// DHCPをつかわない
# nmcli connection modify enp0s3 ipv4.ignore-auto-dns yes

// 設定をアクティベート
# nmcli connection up enp0s3

hostonly (enp0s8)

# nmcli connection modify enp0s8 ipv4.address 192.168.56.13/24
# nmcli connection modify enp0s8 ipv4.method manual
# nmcli connection modify enp0s8 connection.autoconnect yes
# nmcli connection modify enp0s8 ipv6.method disabled
# nmcli connection up enp0s8

サービス再起動

# systemctl restart NetworkManager

再起動後に ip a などで設定を確認。設定が反映されていればひとまず成功!

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?