Link to home
Start Free TrialLog in
Avatar of mickt
micktFlag for Ireland

asked on

why will promiscuosu mode not persist across a reboot in centOS 7?

Hi guys

I've configured promiscuous mode on eth0 in my CentOS 7 installation but it is not persistent across a reboot.  Anyone have an idea as to why?

I've configured in ifcfg-eth0 but this did not work.

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
BOOTPROTO=none
HWADDR=b4:b5:2f:6f:6f:48
ONBOOT=yes
NETBOOT=yes
IPV4_FAILURE_FATAL=no
PROMISC=yes

I've also tried configuring in rc.local file but again this did not work (worked in CentOS 6.4).

# cat /etc/rc.local
#!/bin/bash
..............
..............
ip link set eth0 promisc on

# ifconfig eth0
eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST>  mtu 1500

It is fine when configured in shell but obviously does not persist.

# ip link set eth0 promisc on
# ifconfig eth0
eth0: flags=6467<UP,BROADCAST,RUNNING,PROMISC,SLAVE,MULTICAST>  mtu 1500

I can work around the issue by creating a script in init.d and linking to rc3.d.

# cat /etc/init.d/promisc
#!/bin/sh
# Enable promiscuous mode on eth0
ip link set eth promisc on

Regards
Avatar of simon3270
simon3270
Flag of United Kingdom of Great Britain and Northern Ireland image

The /etc/rc.local one may be a PATH problem - try using "/sbin/ip" rather than just "ip" (assuming your "ip" is in /sbin).

Also make sure you put the command *before* the "exit 0" at the end of the script (only suggest this because I have seen commands after the "exit 0", and confused users wondering why commands weren't run!)
ASKER CERTIFIED SOLUTION
Avatar of mickt
mickt
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Not all "enhancements" are "improvements"!

Well done for spotting the problem.
Avatar of mickt

ASKER

Yes, like that damn Consistent Network Device Name!  Causes me no end of trouble.
Avatar of mickt

ASKER

making script executable resolved issue.