mr/ubuntuでvlan
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
Ubuntu 25.04 でのお話
* netplan を使う [#w1a8c7f2]
#prism(bash){{{
$ diff -u 90-NM-d4735e4b-9bfa-3052-b1c4-ef3302803c9a.yaml...
--- 90-NM-d4735e4b-9bfa-3052-b1c4-ef3302803c9a.yaml 2...
+++ new.yaml 2025-10-08 21:56:11.370205647 +0900
@@ -25,3 +25,13 @@
ipv6.method: "disabled"
ipv6.ip6-privacy: "-1"
proxy._: ""
+ # --- ここからVLAN設定の追加 ---
+ vlans:
+ enp0s31f6.100: # VLANインターフェース名 (親インター...
+ id: 100 # VLAN ID (VID)
+ link: enp0s31f6 # 親となる物理インターフェース
+ addresses: [192.168.100.155/24] # 付与したいIPアド...
+ # デフォルトゲートウェイは不要なため、gateway4やro...
+ renderer: NetworkManager # 親と同じrendererを指定 ...
}}}
からの
#prism(bash){{{
sudo netplan try
sudo netplan apply
}}}
* 以下、失敗の歴史 [#yc95a941]
** nmcliで失敗する [#o4cec9f6]
#prism(bash){{{
sudo nmcli connection add type vlan con-name enp0s31f6.10...
sudo nmcli connection modify enp0s31f6.100 ipv4.addresses...
sudo nmcli connection modify enp0s31f6.100 ipv4.method ma...
sudo nmcli connection modify enp0s31f6.100 ipv4.never-def...
sudo nmcli connection up enp0s31f6.100
}}}
ってやると、最後の最後で
#prism(bash){{{
エラー: 接続のアクティベーションに失敗: Failed to find a ...
}}}
** ipだと一応うまくいく [#d2f86e9e]
#prism(bash){{{
sudo ip link add link enp0s31f6 name enp0s31f6.100 type v...
sudo ip addr add 192.168.100.155/24 dev enp0s31f6.100
sudo ip link set enp0s31f6.100 up
ip a s enp0s31f6.100
}}}
vlan-ifは作れるんだけど、nmcliの管理下ではないのでOSリブ...
** なぜ? [#w069c4b5]
#prism(bash){{{
$ nmcli dev s
DEVICE TYPE STATE CONNECTION
enp0s31f6 ethernet 接続済み netplan-enp0s...
}}}
vlan-ifの接続デバイスが、netplanで管理されているので、nmc...
nmcliで見ると enp0s31f6.100 が出来ている・・・のだが、con...
** あがき [#k27cc827]
途中までipコマンドで作って、nmcliでちょこっと変更する
#prism(bash){{{
sudo ip link add link enp0s31f6 name enp0s31f6.100 type v...
sudo ip addr add 192.168.100.155/24 dev enp0s31f6.100
sudo nmcli connection modify enp0s31f6.100 connection.aut...
sudo nmcli connection modify enp0s31f6.100 ipv4.never-def...
sudo nmcli connection modify up enp0s31f6.100
}}}
やってみれば分かるけど、nmcliの管轄外になってうまくいかない
終了行:
Ubuntu 25.04 でのお話
* netplan を使う [#w1a8c7f2]
#prism(bash){{{
$ diff -u 90-NM-d4735e4b-9bfa-3052-b1c4-ef3302803c9a.yaml...
--- 90-NM-d4735e4b-9bfa-3052-b1c4-ef3302803c9a.yaml 2...
+++ new.yaml 2025-10-08 21:56:11.370205647 +0900
@@ -25,3 +25,13 @@
ipv6.method: "disabled"
ipv6.ip6-privacy: "-1"
proxy._: ""
+ # --- ここからVLAN設定の追加 ---
+ vlans:
+ enp0s31f6.100: # VLANインターフェース名 (親インター...
+ id: 100 # VLAN ID (VID)
+ link: enp0s31f6 # 親となる物理インターフェース
+ addresses: [192.168.100.155/24] # 付与したいIPアド...
+ # デフォルトゲートウェイは不要なため、gateway4やro...
+ renderer: NetworkManager # 親と同じrendererを指定 ...
}}}
からの
#prism(bash){{{
sudo netplan try
sudo netplan apply
}}}
* 以下、失敗の歴史 [#yc95a941]
** nmcliで失敗する [#o4cec9f6]
#prism(bash){{{
sudo nmcli connection add type vlan con-name enp0s31f6.10...
sudo nmcli connection modify enp0s31f6.100 ipv4.addresses...
sudo nmcli connection modify enp0s31f6.100 ipv4.method ma...
sudo nmcli connection modify enp0s31f6.100 ipv4.never-def...
sudo nmcli connection up enp0s31f6.100
}}}
ってやると、最後の最後で
#prism(bash){{{
エラー: 接続のアクティベーションに失敗: Failed to find a ...
}}}
** ipだと一応うまくいく [#d2f86e9e]
#prism(bash){{{
sudo ip link add link enp0s31f6 name enp0s31f6.100 type v...
sudo ip addr add 192.168.100.155/24 dev enp0s31f6.100
sudo ip link set enp0s31f6.100 up
ip a s enp0s31f6.100
}}}
vlan-ifは作れるんだけど、nmcliの管理下ではないのでOSリブ...
** なぜ? [#w069c4b5]
#prism(bash){{{
$ nmcli dev s
DEVICE TYPE STATE CONNECTION
enp0s31f6 ethernet 接続済み netplan-enp0s...
}}}
vlan-ifの接続デバイスが、netplanで管理されているので、nmc...
nmcliで見ると enp0s31f6.100 が出来ている・・・のだが、con...
** あがき [#k27cc827]
途中までipコマンドで作って、nmcliでちょこっと変更する
#prism(bash){{{
sudo ip link add link enp0s31f6 name enp0s31f6.100 type v...
sudo ip addr add 192.168.100.155/24 dev enp0s31f6.100
sudo nmcli connection modify enp0s31f6.100 connection.aut...
sudo nmcli connection modify enp0s31f6.100 ipv4.never-def...
sudo nmcli connection modify up enp0s31f6.100
}}}
やってみれば分かるけど、nmcliの管轄外になってうまくいかない
ページ名: