如果需要在 NIC 上停止过滤包,请使用以下过程。
承担拥有 IP 过滤器管理权限配置文件的角色,或者成为超级用户。
可以将 IP 过滤器管理权限配置文件指定给您创建的角色。有关如何创建该角色并将其指定给用户,请参见《系统管理指南:安全性服务》中的“配置 RBAC(任务列表)”。
启动所选的文件编辑器,然后编辑 /etc/ipf/pfil.ap 文件。
此文件包含主机上 NIC 的名称。已经用于过滤网络通信流量的 NIC 被取消注释。注释掉不再希望用来过滤网络通信流量的设备名称。
# vi /etc/ipf/pfil.ap # IP Filter pfil autopush setup # # See autopush(1M) manpage for more information. # # Format of the entries in this file is: # #major minor lastminor modules #le -1 0 pfil #qe -1 0 pfil #hme -1 0 pfil (Commented-out device no longer filters network traffic) #qfe -1 0 pfil #eri -1 0 pfil #ce -1 0 pfil #bge -1 0 pfil #be -1 0 pfil #vge -1 0 pfil #ge -1 0 pfil #nf -1 0 pfil #fa -1 0 pfil #ci -1 0 pfil #el -1 0 pfil #ipdptp -1 0 pfil #lane -1 0 pfil #dmfe -1 0 pfil |
使用以下方法之一取消激活 NIC:
重新引导计算机。
# reboot |
如果无法在 NIC 上安全地使用 ifconfig unplumb 和 ifconfig plumb 命令,则需要重新引导。
将 ifconfig 命令与 unplumb 和 plumb 选项一起使用,以取消激活 NIC。必须取消检测每个接口的 inet6 版本,以便取消激活 IPv6 包过滤。请执行以下步骤。系统中的样例设备为 hme:
标识取消激活的设备的主要编号。
# grep hme /etc/name_to_major hme 7 |
显示 hme0 的当前 autopush 配置。
# autopush -g -M 7 -m 0 Major Minor Lastminor Modules 7 ALL - pfil |
删除 autopush 配置。
# autopush -r -M 7 -m 0 |
打开设备并为设备指定 IP 地址。
# ifconfig hme0 unplumb # ifconfig hme0 plumb 192.168.1.20 netmask 255.255.255.0 up # ifconfig hme0 inet6 unplumb # ifconfig hme0 inet6 plumb fec3:f840::1/96 up |
有关 ifconfig 命令的更多信息,请参见 ifconfig(1M) 手册页。