Solved

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

Posted on 2014-11-28
5
838 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

740 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