From a274e28e16f2a5e04ff744b8475b1f6520df269f Mon Sep 17 00:00:00 2001 From: raphanaud Date: Wed, 20 Oct 2021 08:28:32 +0200 Subject: [PATCH] rsyslog --- syslog/redirectap33.sh | 5 +++-- syslog/rsyslog | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) mode change 100644 => 100755 syslog/redirectap33.sh create mode 100644 syslog/rsyslog diff --git a/syslog/redirectap33.sh b/syslog/redirectap33.sh old mode 100644 new mode 100755 index 24f78c9..d266fcc --- a/syslog/redirectap33.sh +++ b/syslog/redirectap33.sh @@ -1,4 +1,5 @@ #!/bin/bash -iptables -t nat -A PREROUTING -d 10.121.38.33 -p udp --dport 515 -j DNAT --to-port 192.168.0.40:514 -iptables -t nat -A POSTROUTING -d 192.168.0.40 -p udp --dport 515 -j SNAT --to 10.121.38.32 +echo "1" > /proc/sys/net/ipv4/ip_forward +sudo iptables -t nat -A PREROUTING -d 10.121.38.33 -p udp --dport 515 -j DNAT --to-dest 192.168.0.40:514 +sudo iptables -t nat -A POSTROUTING -d 192.168.0.40 -p udp --dport 515 -j SNAT --to 10.121.38.33 diff --git a/syslog/rsyslog b/syslog/rsyslog new file mode 100644 index 0000000..8d521ca --- /dev/null +++ b/syslog/rsyslog @@ -0,0 +1,25 @@ +/var/log/syslog +/var/log/mail.info +/var/log/mail.warn +/var/log/mail.err +/var/log/mail.log +/var/log/daemon.log +/var/log/kern.log +/var/log/auth.log +/var/log/user.log +/var/log/lpr.log +/var/log/cron.log +/var/log/debug +/var/log/messages +{ + rotate 4 + weekly + missingok + notifempty + compress + delaycompress + sharedscripts + postrotate + /usr/lib/rsyslog/rsyslog-rotate + endscript +}