设置网卡混杂模式

来源:互联网 发布:阿里云服务器申请退款 编辑:程序博客网 时间:2024/06/08 15:36


方法一:

[html] view plaincopy在CODE上查看代码片派生到我的代码片
  1. ~$ sudo ifconfig eth1 promisc   # 设置混杂模式  
  2. ~$ sudo ifconfig eth1 -promisc  

方法二:

[html] view plaincopy在CODE上查看代码片派生到我的代码片
  1. ~$ sudo ip link set eth1 promisc on  
  2. ~$ sudo ip link set eth1 promisc off  

注意:上面两种方法系统重启之后混杂模式会失效



永久设置混杂模式

方法一:加入 /etc/rc.local

[html] view plaincopy在CODE上查看代码片派生到我的代码片
  1. ifconfig eth1 promisc  
or

[html] view plaincopy在CODE上查看代码片派生到我的代码片
  1. ip link set eth1 promisc on  


方法二:/etc/network/interfaces

[html] view plaincopy在CODE上查看代码片派生到我的代码片
  1. iface eth1 inet manual  
  2.   up ifconfig eth1 0.0.0.0 up  

0 0
原创粉丝点击