在juniper环境中可以使用show ethernet-switching table brief 查看mac地址、vlanID和接口的对应关系,后面可以跟上| match 具体mac。
XXXXX@XinXiaoQu-HeXin-1> show ethernet-switching table brief
Ethernet-switching table: 2213 entries, 2161 learned
VLAN MAC address Type Age Interfaces
vlan1024 * Flood - All-members
vlan1024 00:17:61:12:05:2f Learn 1:23 xe-2/0/0.0
vlan1024 30:d1:7e:ec:48:37 Learn 1:18 xe-2/0/0.0
vlan1025 * Flood - All-members
vlan1025 30:d1:7e:ec:48:37 Learn 0 xe-2/0/0.0
vlan1025 50:bd:5f:04:3f:95 Learn 0 ge-4/0/1.0
vlan1025 ec:26:ca:96:5f:7b Learn 0 ge-4/0/1.0
..............................................................
vlan1030 30:d1:7e:ec:48:37 Learn 0 xe-2/0/0.0
vlan1030 44:8a:5b:4e:19:6f Learn 0 xe-2/0/1.0
vlan1030 44:8a:5b:4e:1b:93 Learn 0 xe-2/0/1.0
vlan1030 6c:e8:73:57:73:35 Learn 0 ge-4/0/6.0
vlan1030 b0:95:8e:07:a5:29 Learn 4:21 ge-4/0/6.0
vlan1030 bc:46:99:59:46:a9 Learn 0 xe-2/0/1.0
vlan1030 c8:d3:a3:4a:01:a7 Learn 0 xe-2/0/1.0
vlan1030 d4:3d:7e:25:5e:a0 Learn 0 xe-2/0/1.0
可以使用show arp 查看mac 和ip的对照表。
admin@XinXiaoQu-HeXin-1> show arp
MAC Address Address Name Interface Flags
02:44:81:00:00:05 128.0.0.5 128.0.0.5 bme0.36862 permanent
00:0b:ca:fe:04:00 128.0.0.18 128.0.0.18 bme0.32768 none
00:0b:ca:fe:06:00 128.0.0.20 128.0.0.20 bme0.32768 none
02:44:81:00:00:05 129.0.0.5 129.0.0.5 bme0.36862 permanent
02:44:81:00:00:10 129.0.0.16 129.0.0.16 bme0.36862 permanent
..................................................................
3c:8a:b0:30:ff:f0 192.168.22.1 192.168.22.1 vlan.2 none
78:fe:3d:3d:70:01 192.168.22.3 192.168.22.3 vlan.2 none
78:19:f7:55:8e:00 192.168.22.8 192.168.22.8 vlan.2 none