有时候为嗅探到网络上的数据,需要将网卡设置到混杂模式。进入该模式将网络上的数据一并抓获,为此在设置nic的混杂模式的时候有诸多方法?通过shell命令来实现:
[root@localhost tftpboot]# ifconfig
eth6 Link encap:Ethernet HWaddr 08:00:27:70:1D:79
inet6 addr: fe80::a00:27ff:fe70:1d79/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:100124 errors:0 dropped:0 overruns:0 frame:0
TX packets:8795 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12986638 (12.3 MiB) TX bytes:6452270 (6.1 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1303 errors:0 dropped:0 overruns:0 frame:0
TX packets:1303 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:303973 (296.8 KiB) TX bytes:303973 (296.8 KiB)
[root@localhost tftpboot]# ifconfig eth6 promisc
[root@localhost tftpboot]# ifconfig
eth6 Link encap:Ethernet HWaddr 08:00:27:70:1D:79
inet6 addr: fe80::a00:27ff:fe70:1d79/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:100154 errors:0 dropped:0 overruns:0 frame:0
TX packets:8795 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13007885 (12.4 MiB) TX bytes:6452270 (6.1 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1303 errors:0 dropped:0 overruns:0 frame:0
TX packets:1303 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:303973 (296.8 KiB) TX bytes:303973 (296.8 KiB)
[root@localhost tftpboot]#