Solved

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

Posted on 2014-11-28
5
564 Views
Last Modified: 2014-12-03
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
0
Comment
Question by:mickt
  • 3
  • 2
5 Comments
 
LVL 19

Expert Comment

by:simon3270
ID: 40470334
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!)
0
 

Accepted Solution

by:
mickt earned 0 total points
ID: 40470339
Identified the issue.

# ls -l /etc/rc.d/rc.local
-rw-r--r--. 1 root root 477 Oct 23 12:30 /etc/rc.d/rc.local

Wouldn't mind but it is written in the script!:

# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

I think the is new to 7 as it worked out of the box in 6.4. :(
0
 
LVL 19

Expert Comment

by:simon3270
ID: 40470381
Not all "enhancements" are "improvements"!

Well done for spotting the problem.
0
 

Author Comment

by:mickt
ID: 40470389
Yes, like that damn Consistent Network Device Name!  Causes me no end of trouble.
0
 

Author Closing Comment

by:mickt
ID: 40478150
making script executable resolved issue.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In order for businesses to be compliant with certain information security laws in some countries, you need to be able to prove that a user (which user it was becomes important to the business to take action against the user after an event has occurr…
If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now