mickt
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-scr ipts/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,RU NNING,SLAV E,MULTICAS T> 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,RU NNING,PROM ISC,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
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-scr
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,RU
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,RU
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not all "enhancements" are "improvements"!
Well done for spotting the problem.
Well done for spotting the problem.
ASKER
Yes, like that damn Consistent Network Device Name! Causes me no end of trouble.
ASKER
making script executable resolved issue.
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!)