LoginSignup
2
1

More than 1 year has passed since last update.

Ubuntu20.04でTAG VLANの設定

Posted at

はじめに

Ubuntu Server 20.04 LTSでTAG VLAN(IEEE802.1Q)をしゃべらせてみようかと思ったのでメモ。

untagのVLANが無い設定

ネットでググるとUbuntuでTAG VLANの設定例が多数ありますが、どれも untag + tag 混在環境でした。 主たる接続をuntagにして、追加の接続をtagにしてました。

今回は、すべてtagにしたかった。どうやるんだろ。いろいろ思考錯誤してみた。

こんな感じでいいようです。eth0は実際の環境に合わせて読み替えてください。

network:
    ethernets:
        eth0:
            dhcp4: false

    vlans:
        vlan.1234:
            id: 1234
            link: eth0
            addresses: [203.0.113.2/24]
            optional: false
            gateway4: 203.0.113.1
            nameservers:
               search: [example.jp]
               addresses: [198.51.100.1,192.51.100.2]
        vlan.4567:
            id: 4567
            link: eth0
            addresses: [192.0.2.1/24]
            optional: false
    version: 2

設定後 「netplan apply」して、エラーが出ないか確認してください。

2
1
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
2
1