Mailing List
Home
Forum Home
Linux - General Red Hat Linux discussion list
Installation - Getting started with Red Hat Linux
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
Couldn 't open PID file /var/run/named/named pid Permission denied
sendmail configuration on redhat
kernel 2 6 and /dev/sound/mixer not found
Promise 378 controller
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
Lotus Notes under Wine
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
/etc/security/limits conf question
Intel E/1000 driver
rpm database corrupt
Command stream end of file while reading
qla2300 modules
 
How to permanently set a network interface to promiscuous mode?

How to permanently set a network interface to promiscuous mode?

2007-08-02       - By Joshua Gimer

 Back
Reply:     1     2     3  

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

#!/bin/bash

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
do
        PROM=$(egrep -i 'promisc' ifcfg-$i | awk -F"=" '{ print $2 }')

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

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" ];
then
        /sbin/ifconfig ${DEVICE} promisc
fi

at the end of the file before exit 0.

Josh

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

> Hi,
>
> 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 (See http://pts-7.ora-code.com).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.
>
> Bram
>
>
>
> 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@(protected)?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@(protected)?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list