SONiCで一番原始的な設定変更の方法は

1)/etc/sonic/config_db.jsonを書き換える

2)config reload -y

これをやると一度全てのサービスが再起動するため時間も数分かかるしサービスも一度とまる

configコマンドを使う方法

config vlan add 1000
config vlan member add 1000 Ethernet7 -u
config interface ip add Vlan1000 192.168.100.1/24
show vlan config
config save

Vlanの"V"は大文字であることが必要

admin@sonic-AS7326:/etc/sonic$ show vlan brief
+-----------+------------------+------------+----------------+-----------------------+
|   VLAN ID | IP Address       | Ports      | Port Tagging   | DHCP Helper Address   |
+===========+==================+============+================+=======================+
|      1000 | 192.168.100.1/24 | Ethernet7  | untagged       |                       |
|           |                  | Ethernet8  | untagged       |                       |
|           |                  | Ethernet9  | untagged       |                       |
|           |                  | Ethernet10 | untagged       |                       |
|           |                  | Ethernet11 | untagged       |                       |
|           |                  | Ethernet12 | untagged       |                       |
+-----------+------------------+------------+----------------+-----------------------+
|      1001 | 192.168.101.1/24 | Ethernet13 | untagged       |                       |
|           |                  | Ethernet14 | untagged       |                       |
|           |                  | Ethernet15 | untagged       |                       |
|           |                  | Ethernet16 | untagged       |                       |
|           |                  | Ethernet17 | untagged       |                       |
|           |                  | Ethernet18 | untagged       |                       |
+-----------+------------------+------------+----------------+-----------------------+
admin@sonic-AS7326:/etc/sonic$ show ip interface
Interface    Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP
-----------  --------  -------------------  ------------  --------------  -------------
Ethernet0              10.0.0.0/31          up/down       ARISTA01T2      10.0.0.1
Ethernet1              10.0.0.2/31          up/down       ARISTA02T2      10.0.0.3
Ethernet2              10.0.0.4/31          up/up         ARISTA03T2      10.0.0.5
Ethernet3              10.0.0.6/31          up/up         ARISTA04T2      10.0.0.7
Ethernet4              10.0.0.8/31          up/down       ARISTA05T2      10.0.0.9
Ethernet5              10.0.0.10/31         up/down       ARISTA06T2      10.0.0.11
Ethernet6              10.0.0.12/31         up/down       ARISTA07T2      10.0.0.13
Ethernet7    Bridge    10.0.0.14/31         up/down       ARISTA08T2      10.0.0.15
Ethernet8    Bridge    10.0.0.16/31         up/down       ARISTA09T2      10.0.0.17
Ethernet9    Bridge    10.0.0.18/31         up/down       ARISTA10T2      10.0.0.19
Ethernet10   Bridge    10.0.0.20/31         up/down       ARISTA11T2      10.0.0.21
Ethernet11   Bridge    10.0.0.22/31         up/down       ARISTA12T2      10.0.0.23
Ethernet12   Bridge    10.0.0.24/31         up/down       ARISTA13T2      10.0.0.25
Ethernet13   Bridge    10.0.0.26/31         up/down       ARISTA14T2      10.0.0.27
Ethernet14   Bridge    10.0.0.28/31         up/down       ARISTA15T2      10.0.0.29
Ethernet15   Bridge    10.0.0.30/31         up/down       ARISTA16T2      10.0.0.31
Ethernet16   Bridge    10.0.0.32/31         up/down       ARISTA17T2      10.0.0.33
Ethernet17   Bridge    10.0.0.34/31         up/down       ARISTA18T2      10.0.0.35
Ethernet18   Bridge    10.0.0.36/31         up/down       ARISTA19T2      10.0.0.37
Ethernet19             10.0.0.38/31         up/down       ARISTA20T2      10.0.0.39
------------------------ omit ---------------------------
Ethernet76             10.0.0.110/31        up/down       ARISTA28T0      10.0.0.111
Loopback0              10.1.0.1/32          up/up         N/A             N/A
Vlan1000               192.168.100.1/24     up/down       N/A             N/A
Vlan1001               192.168.101.1/24     up/down       N/A             N/A
docker0                240.127.1.1/24       up/down       N/A             N/A
lo                     127.0.0.1/8          up/up         N/A             N/A
$ sudo vim /etc/sonic/config_db.json

This is what a typical VLAN setup would look like, just add the interfaces and VLANs you wish to use.

"VLAN": {
    "Vlan3002": {
        "members": [
            "Ethernet0",
            "Ethernet4"
        ],
        "vlanid": "3002"
    }
},

"VLAN_MEMBER": {
    "Vlan3002|Ethernet0": {
        "tagging_mode": "tagged"
    },
    "Vlan3002|Ethernet4": {
        "tagging_mode": "untagged"
    }
}

Once you have finished editing the json file, run this command to reload the config:

$ sudo config reload -y