配置环境

  • 操作系统发布“RHEL 7.1”
  • 内核 3.8.13-55.1.6.el7.x86_64
  • 硬件:HP ProLiant BL460c Gen8
  • 存储 HP 3PAR StoreServ Storage 服务器(FCoE 目标)。
  • 交换机 启用 FCoE 的交换机。
  • 具有 FCoE 功能的以太网接口 :
04:00.0 Ethernet controller: Broadcom Corporation BCM57840 NetXtreme II 10/20-Gigabit Ethernet (rev 11) 
04:00.1 Ethernet controller: Broadcom Corporation BCM57840 NetXtreme II 10/20-Gigabit Ethernet (rev 11) 
04:00.2 Ethernet controller: Broadcom Corporation BCM57840 NetXtreme II 10/20-Gigabit Ethernet (rev 11) 
04:00.3 Ethernet controller: Broadcom Corporation BCM57840 NetXtreme II 10/20-Gigabit Ethernet (rev 11) 
04:00.4 Ethernet controller: Broadcom Corporation BCM57840 NetXtreme II 10/20-Gigabit Ethernet (rev 11) 
04:00.5 Ethernet controller: Broadcom Corporation BCM57840 NetXtreme II 10/20-Gigabit Ethernet (rev 11)
如何在 CentOS/RHEL 中配置以太网光纤通道 (FCoE) 接口

FCoE 全称为 Fiber-Channel Over Ethernet (以太网光纤通道)

欢迎 on it road

配置步骤

按照下面的步骤在 CentOS/RHEL 系统中配置 FCoE 接口。

  1. 使用系统 BIOS 配置 FCoE 有关如何在可用接口上启用 FCoE 的说明,请参阅服务器硬件文档。

  2. 安装所需的包:

# yum install fcoe-utils lldpad
  1. 找出为 FCoE 配置的接口 在这个例子中它的 eno3 (6C:C2:17:2B:4D:11) 和 eno4 (6C:C2:17:2B:4D:19)。

  2. 配置以太网接口使用 FCoE 关闭接口和 fcoe 服务,如果运行:

# ifconfig eno3 down
# ifconfig eno4 down

# systemctl stop fcoe      ### if running
  1. 通过将现有网络脚本(例如:vi /etc/fcoe/cfg-eth0)复制到支持 FCoE 的以太网设备的名称来配置新 VLAN。
    配置文件 /etc/fcoe/cfg-eth0 将为我们提供要配置的默认设置。
    假设 FCoE 设备是 ethX,请运行:
# cp /etc/fcoe/cfg-eth0 /etc/fcoe/cfg-ethX

修改 FCoE 配置文件如下:

# cp /etc/fcoe/cfg-eth0 /etc/fcoe/cfg-eno3
# cp /etc/fcoe/cfg-eth0 /etc/fcoe/cfg-eno4
  1. 通过将 DCB_REQUIRED 设置为“no”来修改 /etc/fcoe/cfg-[interface]。
    对于实现硬件 DCBX 客户端的网络接口,DCB_REQUIRED 应设置为 no。
    这里我们没有使用任何硬件 DCBX 客户端。
    有关数据中心桥接的更多信息,请访问 http://linux.die.net/man/8/fcoemon。

例如:

$ cat /etc/fcoe/cfg-eno3
## Type: yes/no
## Default: no
# Enable/Disable FCoE service at the Ethernet port
# Normally set to "yes"
FCOE_ENABLE="yes"
## Type: yes/no
## Default: no
# Indicate if DCB service is required at the Ethernet port
# Normally set to "yes"
DCB_REQUIRED="no"
#DCB_REQUIRED="yes"
## Type: yes/no
## Default: no
# Indicate if VLAN discovery should be handled by fcoemon
# Normally set to "yes"
AUTO_VLAN="yes"
## Type: fabric/vn2vn
## Default: fabric
# Indicate the mode of the FCoE operation, either fabric or vn2vn
# Normally set to "fabric"
MODE="fabric"
## Type: yes/no
## Default: no
# Indicate whether to run a FIP responder for VLAN discovery in vn2vn mode
#FIP_RESP="yes"

对 eno4 接口执行相同操作。

  1. 启动时激活接口并启用巨型帧 在相应的 /etc/sysconfig/network-scripts/ifcfg-eno3 和 /etc/sysconfig/network-scripts/ifcfg-eno4 文件中设置“ONBOOT=yes”以在启动期间自动激活时间。
    还要在启用 FCoE 的接口上启用巨型帧 (MTU=9000)。
    通过在接口上启用巨型帧,将避免不必要的 IP 分段。
# cat /etc/sysconfig/network-scripts/ifcfg-eno3
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno3
UUID=fae9a6da-f05b-497e-b625-ba5826db0d78
DEVICE=eno3
#ONBOOT=no 
ONBOOT=yes
MTU=9000
# cat /etc/sysconfig/network-scripts/ifcfg-eno4
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno4
UUID=63157ec1-3013-4895-8ea4-079c5865d364
DEVICE=eno4
#ONBOOT=no 
ONBOOT=yes
MTU=9000
  1. 对于需要软件 DCBX 客户端的接口使用以下命令在以太网接口上启用数据中心桥接:
# dcbtool sc ethX dcb on

然后,通过运行以下命令在以太网接口上启用 FCoE:

# dcbtool sc ethX app:fcoe e:1

使用以下命令在以太网接口上启用数据中心桥接:

# dcbtool sc eno3 dcb on
# dcbtool sc eno4 dcb on

然后,通过运行以下命令在以太网接口上启用 FCoE:

# dcbtool sc eno3 app:fcoe e:1
# dcbtool sc eno4 app:fcoe e:1
  1. 调出接口并启动fcoe服务:
# ifconfig eno3 up
# ifconfig eno4 up
  1. 使用以下命令启动 FCoE:
# systemctl start fcoe
  1. 使用以下命令启动数据中心桥接守护进程 (dcbd):
# /etc/init.d/lldpad start
  1. 查看配置的FCoE设备:
# fcoeadm -i

正确配置以太网接口以使用 FCoE 后,将“fcoe”和“lldpad”设置为在启动时运行。
为此,请在 CentOS/RHEL 6.x 中使用 chkconfig,如下所示:

# chkconfig lldpad on
# chkconfig fcoe on

或者在 CentOS/RHEL 7.x 中:

# systemctl enable fcoe
# systemctl enable lldpad
日期:2020-09-17 00:13:18 来源:oir作者:oir