2018年9月6日 星期四

LEAF Bering-uClibc 6.1.4 ulogd + mariadb server 摘要

1.debian 9 安裝 mariadb server
apt-get install mysql-server ulogd2-mysql

2.開啟 mariadb server 遠端存取
修改 /etc/mysql/mariadb.conf.d/50-server.cnf
#bind-address            = 127.0.0.1

3.設定 mariadb server ulog 設定
echo create database nulog|mysql
cat /usr/share/doc/ulogd2-mysql/mysql-ulogd2.sql.gz |gzip -d |mysql nulog
grant all privileges on nulog.* to nupik@% identified by 'changeme';
flush privileges;

4.LEAF 安裝 ulogd-mysql 套件
apkg -i ulogd-mysql

5.LEAF 修改 ulogd 設定
編輯 /etc/ulogd.conf 加入
/usr/lib/ulogd/ulogd_output_MYSQL.so
stack=log4:NFLOG,base1:BASE,ifi1:IFINDEX,ip2bin1:IP2BIN,mac2str1:HWHDR,mysql1:MYSQL

[mysql1]
db="nulog"
host="192.168.1.1"
user="nupik"
table="ulog"
pass="changeme"
procedure="INSERT_PACKET_FULL"

[mysql2]
db="nulog"
host="192.168.1.1"
user="nupik"
table="conntrack"
pass="changeme"
procedure="INSERT_CT"

沒有留言: