Для данной оси все просто, есть порт с сией тулзой, будем ставить из него 🙂
# cd /usr/ports/net/udpxy/
# make install clean
появится окно выбора параметров, ставим галки напротив RELEASE
[X] RELEASE No asserts, no debug symbols, verbose mode on
[ ] LEAN No asserts, no debug symbols, verbose mode off
[ ] DEBUG Asserts, debug symbols, verbose mode on
не забываем сделать
# rehash
смотрим результат:
# udpxy
udpxy 1.0-21.2 (prod) standard [FreeBSD 8.3-RELEASE-p3 amd64]
usage: udpxy [-vTS] [-a listenaddr] -p port [-m mcast_ifc_addr] [-c clients] [-l logfile] [-B sizeK] [-n nice_incr]
-v : enable verbose output [default = disabled]
-S : enable client statistics [default = disabled]
-T : do NOT run as a daemon [default = daemon if root]
-a : (IPv4) address/interface to listen on [default = 0.0.0.0]
-p : port to listen on
-m : (IPv4) address/interface of (multicast) source [default = 0.0.0.0]
-c : max clients to serve [default = 3, max = 5000]
-l : log output to file [default = stderr]
-B : buffer size (65536, 32Kb, 1Mb) for inbound (multicast) data [default = 2048 bytes]
-R : maximum messages to store in buffer (-1 = all) [default = 1]
-H : maximum time (sec) to hold data in buffer (-1 = unlimited) [default = 1]
-n : nice value increment [default = 0]
-M : periodically renew multicast subscription (skip if 0 sec) [default = 0 sec]
Examples:
udpxy -p 4022
listen for HTTP requests on port 4022, all network interfaces
udpxy -a lan0 -p 4022 -m lan1
listen for HTTP requests on interface lan0, port 4022;
subscribe to multicast groups on interface lan1
udpxy and udpxrec are Copyright (C) 2008-2011 Pavel V. Cherenkov and licensed under GNU GPLv3
Contact by email: [email protected]; ICQ # 7197767
# ee /etc/rc.conf
В rc.conf добавляем ее в автозагрузку, а также прописываем параметры:
udpxy_enable="YES"
udpxy_flags="-p 4000 -m igb1 -c500"
т.е. слушаем на 4000 порту, интерфейс с мультикастом gb1, максимальное число клиентов 500.
Следить можно так:
http://192.168.100.1:4000/status