Creating span port using netgraph




Hi,

I'm trying to setup a "span" Interface for using with snort. Basically, the span interface should receive a copy of all IP packets seen on my real network interfaces, with the purpose that snort can snoop this interface.

After reading the manuals, and searching the Internet I came up with the following script:

#!/bin/sh

# load ng_ether to get ethernet interfaces
if ! kldstat -v | grep ng_ether > /dev/null 2>&1; then
        kldload ng_ether
fi

# create ngeth0 and bind xl0, xl1, xl2 and xl3 to it
ngctl mkpeer . eiface hook ether
ngctl mkpeer ngeth0: one2many lower one
ngctl connect xl0: ngeth0:lower lower many0
ngctl connect xl1: ngeth0:lower lower many1
ngctl connect xl2: ngeth0:lower lower many2
ngctl connect xl3: ngeth0:lower lower many3

# bring up ngeth0 for sniffing duties
ifconfig ngeth0 monitor up

After I run this script, all network connections freeze and I lost all IP connectvity. If I tcpdup on any inteface (xl? or ngeth0) no traffic is visible.

Maybe I'm overlooking the obvious, but I do not understand why it does not work....

Any help is appreciated! I'm using FreeBSD 6-STABLE.

Regards,

Frank


_______________________________________________ freebsd-net@xxxxxxxxxxx mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Snort IDS + TAPS
    ... the RX and TX streams from your INTERFACE 1 and INTERFACE 2 and run ... Note that when a program such as snort or tcpdump sets the bonded ... > Network with over 10,000 of the brightest minds in information security ... most highly-anticipated industry event of the year. ...
    (Focus-IDS)
  • RE: Win32 Snort Question
    ... Basically the gig is that snort doesn't use the tcp/ip stack at all. ... > flow across the interface. ... > I would avoid putting firewall software on the machine as it ...
    (Security-Basics)
  • using netgraph to connect 2 physical interfaces into one virtual interface
    ... ifconfig em0 up ... ngctl mkpeer em0: one2many upper one ... ngctl connect em0: em0:upper lower many0 ... now if I ifconfig -arp the ngeth0 interface and add the default route, ...
    (freebsd-hackers)
  • using netgraph to connect 2 physical interfaces into one virtual interface
    ... ifconfig em0 up ... ngctl mkpeer em0: one2many upper one ... ngctl connect em0: em0:upper lower many0 ... now if I ifconfig -arp the ngeth0 interface and add the default route, ...
    (freebsd-net)
  • RE: SNORT config Question
    ... I assume you're using the linux version of snort, if you're connecting ... That the IP address is dynamically assigned on the interface ... Using a Win Modem... ...
    (Security-Basics)