set vlans vlan10 vlan-id 10 set vlans vlan20 vlan-id 20
設定網段
set interfaces vlan unit 10 family inet address 192.168.1.1/24 set interfaces vlan unit 20 family inet address 192.168.1.2/24
設定Port Mode
set interfaces ge-0/0/0 unit 0 family ethernet-switching port-mode access set interfaces ge-0/0/2 unit 0 family ethernet-switching port-mode access
將VLAN設定到網卡上
set interfaces ge-0/0/0 unit 0 family ethernet-switching vlan members vlan10 set interfaces ge-0/0/2 unit 0 family ethernet-switching vlan members vlan20
檢查是否正確
commit check
確定修改,並查詢目前的VLAN狀況
commit run show vlans
設定VLAN trunk
set interfaces ge-0/0/1 unit 0 family ethernet-switching vlan members [ vlan10 vlan20 ] set interfaces ge-0/0/1 unit 0 family ethernet-switching port-mode trunk