configure a network interface into promiscuous mode

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

and when i execute

netstat -i

the flag is BMRU

Is my configuration correct or do i need to execute some extra commands.

3

3 Answers

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

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.

2

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like