[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: How to permanently set a network interface to promiscuous mode?

What about adding support for PROMISC yourself in an init script that runs after "network". Maybe something like:


cd /etc/sysconfig/network-scripts/

interfaces=`ls ifcfg* | LANG=C egrep -v '(ifcfg-lo|:|-range|rpmsave| rpmorig|rpmnew)' | \
            LANG=C egrep -v '(~|\.bak)$' | \
            LANG=C egrep 'ifcfg-[A-Za-z0-9\._-]+$' | \
            sed 's/^ifcfg-//g' |
            sed 's/[0-9]/ &/' | LANG=C sort -k 1,1 -k 2n | sed 's/ //'`

for i in $interfaces
        PROM=$(egrep -i 'promisc' ifcfg-$i | awk -F"=" '{ print $2 }')

        if [ "$PROM" = "yes" ];
                /sbin/ifconfig $i promisc

Or you can add support for it in /etc/sysconfig/network-scripts/ifup- post, something like:

PROM=$(egrep -i 'promisc' ifcfg-${DEVICE} | awk -F"=" '{ print $2 }')

if [ "$PROM" = "yes" ];
        /sbin/ifconfig ${DEVICE} promisc

at the end of the file before exit 0.


On Aug 1, 2007, at 1:42 AM, Mertens, Bram wrote:


We need to configure a network interface on one of our machines so that
it always gets set to promiscuous mode.

So far I have manually issued "ifconfig eth1 promisc" but I wouldn't
like to do this every time the interface has been brought down and up
again. According to /usr/share/doc/initscripts-7.93.25.EL/ sysconfig.txt
there used to be a "PROMISC=yes" option that could be used in the
"/etc/sysconfig/network-scripts/ifcfg-eth1" file but apparantely this
option is deprecated and the file reads "To properly set these, use the
packet socket interface."

So far I haven't been able to find any documentation on this packet
socket interface. How can I configure this netwxork interface to always
come up in promiscuous mode?

Thanks in advance.


Mazda Motor Logistics Europe NV, Blaasveldstraat 162, B-2830 Willebroek VAT BE 406.024.281, RPR Mechelen, ING 310-0092504-52, IBAN : BE64 3100 0925 0452, SWIFT : BBRUBEBB

redhat-list mailing list
unsubscribe mailto:redhat-list-request redhat com?subject=unsubscribe

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]