Solved

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

Posted on 2014-11-28
5
704 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you sitting there reading this and wondering how to get started with Linux? It almost seems like picking the right Linux distribution is about like picking the right college or buying a new car if you read some of the article out there. Relax… l…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

778 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