#pc1 192.168.100.2/24 gw 192.168.100.1 /24 , interface ge-0/0/18.0 vlan-id 100 #pc2 192.168.101.2/24 gw 192.168.101.1 /24 , interface ge-0/0/16.0 vlan-id 101 # 不同VLAN 通信,pc1->pc2 , pc2->pc1 # 1)定义二层接口interfaces ->ge-0/0/x unit 0 family ethernet-switching{ port-mode access;} # 2)定义三层接口interfaces ->vlan->unit xxx-> family inet{ 如:address 192.168.101.1/24;} { # 3)定义Vlans,关联二层接口和三层接口,如vlan100 ,vlan101 test@ex4200# show ## Last changed: 2013-09-13 07:59:49 UTC version 12.3R4.6; system { host-name ex4200; ...... } # 1)定义二层接口interfaces interfaces { ...... ge-0/0/16 { unit 0 { family ethernet-switching { port-mode access; } } } ...... ge-0/0/18 { unit 0 { family ethernet-switching { port-mode access; } } } ...... #定义管理接口ip地址 me0 { unit 0 { family inet { address 192.168.1.1/24; } } } #2)定义三层接口,如:l3-interface vlan.100 ,vlan.101 vlan { unit 0 { family inet { dhcp { vendor-id Juniper-ex4200-24t; } } } unit 100 { description "VLAN 100"; family inet { address 192.168.100.1/24; } } unit 101 { family inet { address 192.168.101.1/24; } } } vme { unit 0 { family inet { dhcp { vendor-id Juniper-ex4200-24t; } } } } } # 3)定义Vlans,关联二层接口和三层接口 vlans { default { l3-interface vlan.0; } ...... vlan100 { vlan-id 100; interface { ge-0/0/18.0; } l3-interface vlan.100; } vlan101 { vlan-id 101; interface { ge-0/0/16.0; } l3-interface vlan.101; } ...... } {master:0}[edit] test@ex4200#