Pra*_*ntB 5 networking configuration centos network-interface
如何在网络适配器上启用混杂模式。我已经加入试图PROMISC=yes
在/etc/sysconfig/network-scripts/ifcfg-ensxxx
即使网络重启,但没有效果或重新启动系统。
CentOS 7 /usr/share/doc/initscripts-9.49.24/sysconfig.txt 说:
Run Code Online (Sandbox Code Playgroud)No longer supported: PROMISC=yes|no (enable or disable promiscuous mode) ALLMULTI=yes|no (enable or disable all-multicast mode)
因此,为了启用你必须运行:
ip link set ethX promisc on
Run Code Online (Sandbox Code Playgroud)
或者,如果您想在启动时发生,您可以使用systemd
service rc-local
。
将上面的行放入/etc/rc.d/rc.local
(不要忘记用正确的设备更改 ethX),然后:
chmod u+x /etc/rc.d/rc.local
systemctl enable rc-local
systemctl start rc-local
Run Code Online (Sandbox Code Playgroud)