19

I am working on Ubuntu 12.04 LTS server on VMware Workstation. I need to configure my network interface to work in promiscuous mode.

This is my configuration:

auto eth1
iface eth1 inet manual
up ip address add 0/0 dev $IFACE
up ip link set $IFACE up
up ip link set $IFACE promisc on

down ip link set $IFACE promisc off down ip link set $IFACE down

When I execute

netstat -i

the flag is BMRU.

Is my configuration correct or do I need to execute some extra commands?

ghassen
  • 439

3 Answers3

27

Your interface is not in promiscous mode. Use:

ip link set eth1 promisc on

The flag will be updated to BMPRU. Flag details are as follows:

  • B flag is for broadcast
  • M flag is for multicast
  • P flag is for promisc mode
  • R is for running
  • U is for up
Aditya
  • 13,616
AkaSh
  • 391
13

Well the problem is not in the network card because VMware always enables promiscuous mode for virtual interface. But the problem is within the configuration. It is not enough to enable promiscuous mode in the interface file. I had to add this line:

ifconfig eth1 up
ifconfig eth1 promisc

in the /etc/rc.local file because when i restart the network service, eth1 is set down. So adding this lines would tell the os to not shutdown eth1.

muru
  • 207,228
ghassen
  • 439
12

enable promiscuous mode

vikram@vikram-Lenovo-G580:~$ sudo ifconfig eth0 promisc
vikram@vikram-Lenovo-G580:~$ netstat -i
Kernel Interface table
Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR  Flg
eth0       1500 0     26631      0      0 0         27143      0      0      0 BMPRU

disable promiscuous mode

sudo ifconfig eth0 -promisc
sudo tail -f /var/log/syslog
kernel: [ 2155.176013] device eth0 left promiscuous mode

netstat -i
Kernel Interface table
Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0       1500 0     29172      0      0 0         29850      0      0      0 BMRU