├── Makefile ├── README.md └── mirror.c /Makefile: -------------------------------------------------------------------------------- 1 | obj-m := mirror.o 2 | 3 | ifndef KERNEL_DIR 4 | KERNEL_DIR=/lib/modules/$(shell uname -r)/build 5 | endif 6 | 7 | ALL: 8 | make -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules 9 | 10 | clean: 11 | rm -rf *.o *.ko .tmp* .*cmd *.mod.c *.symvers 12 | 13 | install: 14 | mkdir -p /lib/modules/`uname -r`/kernel/drivers/PT 15 | cp mirror.ko /lib/modules/`uname -r`/kernel/drivers/PT/ 16 | depmod -a 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MIRROR 2 | 3 | ## Description 4 | 5 | Port Mirroring. 6 | 7 | Copy traffic from specified interfaces to MIRROR port. 8 | 9 | Tested kernel version: 2.6.23, 2.6.29, 2.6.37 10 | 11 | ## Compile 12 | 13 | $ make 14 | 15 | ## Install 16 | 17 | $ sudo make install 18 | 19 | ## Usage 20 | 21 | $ sudo modprobe mirror mirror=ethA/ethB/ethC@ethZ 22 | Mirror ethA, ethB, ethC, ... to ethZ 23 | 24 | $ sudo modprobe mirror mirror=eth2/eth3@eth0 25 | Mirror eth2 and eth3 to eth0. 26 | 27 | $ sudo modprobe mirror mirror=eth0@eth1 28 | Mirror eth0 to eth1. 29 | -------------------------------------------------------------------------------- /mirror.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/platinum-PT/MIRROR/ccb3c13be1941abb732c26184e84881ac953a29a/mirror.c --------------------------------------------------------------------------------