以太网接口
了解以太网技术,这些技术用于在安全设备上广播流量、静态 ARP 条目、创建和删除以太网接口,以及在这些接口上启用和禁用混合模式。另请了解聚合以太网接口
以太网接口概述
以太网是一种第 2 层点对多点技术,在共享总线拓扑中运行,支持广播传输,并具有分布式访问控制。
在共享总线拓扑中,所有设备都连接到一个共享物理链路,所有数据传输都通过该链路发送。单个以太网拓扑中的设备组成一个广播域。
物理硬件不会向发送方提供有关传入和丢失流量的信息。更高层的协议(如 TCP/IP)可以提供这种类型的通知。
| 类型 | 说明 |
|---|---|
| 以太网接入控制和传输 |
|
| 冲突和检测 |
|
| 冲突域和 LAN 分段 |
|
|
| 圆 |
套装尺寸 |
集合中的元素 |
|---|---|---|
| 1 |
2 |
|
| 2 |
4 |
|
| 3 |
8 |
|
| 4 |
16 |
|
| 5 |
32 |
|
| 6 |
64 |
|
| 7 |
128 |
|
| 8 |
256 |
|
| 9 |
512 |
|
| 10 |
1024 |
|
以太网帧
数据以帧为单位通过以太网传输。这些帧的长度可变,从 64 个八位位组到 1518 个八位位组不等,包括标头、有效负载和循环冗余校验 (CRC) 值。图 1 显示了以太网帧格式。
以太网帧具有以下字段:
-
前导码 (PRE) 字段是 7 个交替的 0 和 1 的八位位组。序言中的可预测格式允许接收接口自身与正在发送的数据同步。前导码后面是 1 个八位字节的帧开始分隔符 (SFD)。
-
目标地址 (DA) 和源地址 (SA) 字段包含网络上目标端口和源端口的 6 个八位组(48 位)MAC 地址。这些第 2 层地址可唯一标识 LAN 上的设备。
-
长度/类型字段是一个 2 个八位位组字段,用于指示帧数据字段的长度或标识与帧关联的协议栈。以下是一些常见的帧类型:
-
AppleTalk—
0x809B -
AppleTalk ARP—
0x80F3 -
DECnet—
0x6003 -
IP—
0x0800 -
IPX—
0x8137 -
环路 —
0x9000 -
XNS—
0x0600
-
-
“数据”字段包含数据包有效负载。
-
帧检查序列 (FCS) 是一个 4 个八位位组字段,其中包含计算出的 CRC 值。此值由始发主机计算并追加到帧中。接收主机在收到帧时,计算 CRC 并根据此附加值进行检查,以验证所接收帧的完整性。
-
在 SRX650 设备上,接口 ge-0/0/0 到 ge-0/0/3 不支持 MAC 暂停帧和 FCS 错误帧计数器。(平台是否支持取决于设备安装的 Junos OS 版本。)
混合模式
-
在第 3 层以太网接口上启用混合模式时,无论数据包的目标 MAC 地址如何,都将发送至中心点或服务处理单元 (SPU)。
-
您还可以在机箱群集、冗余以太网接口和聚合以太网接口上启用混合模式。
-
如果在冗余以太网接口上启用混合模式,则会在任何子物理接口上启用该模式。如果在聚合以太网接口上启用混合模式,则会在所有成员接口上启用该模式。
-
I/O 卡 (IOC) 和 SRX5000 系列模块端口集中器 (SRX5K-MPC) 上的 1 千兆、10 千兆、40 千兆和 100 千兆以太网接口支持混合模式功能。
-
默认情况下,接口启用 MAC 过滤。您可以在接口上配置混合模式以禁用 MAC 过滤。删除配置时,接口将再次执行 MAC 过滤。
-
当接口在混合模式下工作时,您可以更改接口 MAC 地址。当接口以正常模式运行时,IOC 上的 MAC 过滤功能会使用新的 MAC 地址过滤数据包。
示例:配置以太网接口
概述
表介绍了在路由设备上创建和(可选)删除以太网接口的步骤。
| 配置步骤 |
命令 |
|---|---|
| 步骤一:创建以太网接口并设置逻辑接口。 |
[edit] user@host# edit interfaces ge-1/0/0 unit 0 |
| 步骤 2:如果完成设备配置,请提交配置。 |
[edit] user@host# commit |
| 步骤 3:(可选)指定要删除的接口。 |
[edit] user@host# delete interfaces ge-1/0/0 |
| 第 4 步:如果完成设备配置,请提交配置。 |
[edit] user@host# commit |
示例:在 SRX5K-MPC 上配置混合模式
此示例说明如何在SRX5600的 SRX5K-MPC 接口上配置混合模式以禁用MAC 地址过滤。
CLI 快速配置
下表指定了用于在 SRX5K-MPC 接口上配置和禁用混合模式的 CLI 快速配置命令。
| 配置步骤 |
CLI 快速配置命令 |
|---|---|
| 在接口上配置混合模式 | set interfaces et-4/0/0 unit 0 family inet address 10.1.1.1/24 set interfaces et-4/0/0 promiscuous-mode |
| 禁用接口上的混合模式 | user@host# delete interfaces et-4/0/0 promiscuous-mode |
在接口上配置混合模式
下表介绍了在安全设备上的接口上配置混合模式的分步说明。
| 配置步骤 |
命令 |
|---|---|
| 步骤 1:配置入口接口。 |
[edit interfaces] user@host# set et-4/0/0 unit 0 family inet address 10.1.1.1/24 |
| 步骤 2:在接口上启用混合模式。 |
[edit interfaces] user@host# set et-4/0/0 promiscuous-mode |
| 步骤 3:(可选)禁用接口上的混合模式。 |
[edit] user@host# delete interfaces et-4/0/0 promiscuous-mode |
show interfaces使用命令查看配置的输出。
验证
目的
验证接口上是否启用了混合模式及其状态,以及接口上是否禁用了混合模式。
行动
-
显示有关在混合模式接口上配置的参数的信息。
user@host> show interfaces
Physical interface: et-4/0/0, Enabled, Physical link is Up Interface index: 137, SNMP ifIndex: 511 Link-level type: Ethernet, MTU: 1518, Speed: 100Gbps, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled Device flags : Present Running Interface flags: Promiscuous SNMP-Traps Internal: 0x4000 CoS queues : 8 supported, 8 maximum usable queues Current address: 2c:21:72:3a:05:28, Hardware address: 2c:21:72:3a:05:28 Last flapped : 2014-01-17 14:44:53 PST (5d 06:30 ago) Input rate : 0 bps (0 pps) Output rate : 0 bps (0 pps) Active alarms : None Active defects : None PCS statistics Seconds Bit errors 0 Errored blocks 0 Logical interface et-4/0/0.0 (Index 71) (SNMP ifIndex 513) Flags: SNMP-Traps 0x4000 VLAN-Tag [ 0x8100.1351 ] Encapsulation: ENET2 Input packets : 0 Output packets: 0 Security: Zone: HOST Allowed host-inbound traffic : any-service bfd bgp dvmrp igmp ldp msdp nhrp ospf pgm pim rip router-discovery rsvp sap vrrp Protocol inet, MTU: 1500 Flags: Sendbcast-pkt-to-re Addresses, Flags: Is-Preferred Is-Primary Destination: 122.122.122/24, Local: 122.122.122.1, Broadcast: 122.122.122.255 Protocol multiservice, MTU: Unlimited Flags: Is-Primary Logical interface et-4/0/0.32767 (Index 72) (SNMP ifIndex 517) Flags: SNMP-Traps 0x4004000 VLAN-Tag [ 0x0000.0 ] Encapsulation: ENET2 Input packets : 0 Output packets: 0 Security: Zone: HOST Allowed host-inbound traffic : any-service bfd bgp dvmrp igmp ldp msdp nhrp ospf pgm pim rip router-discovery rsvp sap vrrp Protocol multiservice, MTU: Unlimited Flags: None字段
Interface flags: Promiscuous显示接口上已启用混合模式。 -
验证接口上是否有效
et-4/0/0。使用不同于接口 MAC 地址的 MAC 地址将et-4/0/0流量发送到接口,然后打开混合模式。在作模式下,输入monitor interface traffic命令。user@host> monitor interface traffic
Interface Link Input packets (pps) Output packets (pps) gr-0/0/0 Up 0 (0) 0 (0) ip-0/0/0 Up 0 (0) 0 (0) lt-0/0/0 Up 0 (0) 0 (0) xe-1/2/0 Down 0 (0) 0 (0) xe-1/2/1 Down 0 (0) 0 (0) xe-1/2/2 Down 0 (0) 0 (0) xe-1/2/3 Down 0 (0) 0 (0) xe-1/2/4 Down 0 (0) 0 (0) xe-1/2/5 Down 0 (0) 0 (0) xe-1/2/6 Down 0 (0) 0 (0) xe-1/2/7 Down 0 (0) 0 (0) xe-1/2/8 Down 0 (0) 0 (0) xe-1/2/9 Down 0 (0) 0 (0) et-4/0/0 Up 4403996 (100002) 0 (0) et-4/2/0 Up 3 (0) 4403924 (99997) avs0 Up 0 (0) 0 (0) avs1 Up 0 (0) 0 (0) dsc Up 0 0 em0 Up 15965 14056
input packets和pps字段显示启用混合模式后,流量正在按预期通过et-4/0/0接口。 -
验证禁用的混合模式是否在接口上
et-4/0/0工作。发送流量并关闭混合模式。user@host> monitor interface traffic
Interface Link Input packets (pps) Output packets (pps) gr-0/0/0 Up 0 (0) 0 (0) ip-0/0/0 Up 0 (0) 0 (0) lt-0/0/0 Up 0 (0) 0 (0) xe-1/2/0 Down 0 (0) 0 (0) xe-1/2/1 Down 0 (0) 0 (0) xe-1/2/2 Down 0 (0) 0 (0) xe-1/2/3 Down 0 (0) 0 (0) xe-1/2/4 Down 0 (0) 0 (0) xe-1/2/5 Down 0 (0) 0 (0) xe-1/2/6 Down 0 (0) 0 (0) xe-1/2/7 Down 0 (0) 0 (0) xe-1/2/8 Down 0 (0) 0 (0) xe-1/2/9 Down 0 (0) 0 (0) et-4/0/0 Up 11505495 (0) 0 (0) et-4/2/0 Up 6 (0) 11505425 (0) avs0 Up 0 (0) 0 (0) avs1 Up 0 (0) 0 (0) dsc Up 0 0 em0 Up 37964 31739
字段
pps显示禁用混合模式后,流量未通过et-4/0/0接口。