Solved

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

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

New! My Passport Wireless Pro Wi-Fi Mobile Storage

Portable wireless storage to offload, edit, and stream anywhere.

High-capacity, wireless mobile storage designed to accompany professional photographers and videographers in the field to easily offload, edit and stream captured photos and high-definition videos.

Question has a verified solution.

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

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

863 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

21 Experts available now in Live!

Get 1:1 Help Now