First you need to edit the com.apple.syslogd.plist which is found in /System/Library/LaunchDaemons and add a child entry (NetworkListener) under the Sockets dictionary.
If the file is in binary mode you need to convert it to xml first. Type the following in a terminal window.
sudo plutil -convert xml1 /System/Library/LaunchDaemons/com.apple.syslogd.plist
and save the file (Ctrl+X, answer the question with Y).
If the file is in binary mode you need to convert it to xml first. Type the following in a terminal window.
sudo plutil -convert xml1 /System/Library/LaunchDaemons/com.apple.syslogd.plist
Edit the file and save. We need to convert the file back to binary mode.
sudo plutil -convert binary1 /System/Library/LaunchDaemons/com.apple.syslogd.plist
After that you need to create a logfile. Open up a terminal window and type
sudo plutil -convert binary1 /System/Library/LaunchDaemons/com.apple.syslogd.plist
After that you need to create a logfile. Open up a terminal window and type
sudo touch /var/log/router.log
You can replace router.log with anything else you like.
Now in the same terminal window type
sudo nano /etc/syslog.conf
Add an entry to the file
local2.* /path/to/your/logfile
and save the file (Ctrl+X, answer the question with Y).
Final thing to do on MacOS side is to restart the syslog daemon.
sudo launchctrl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
sudo launchctrl load /System/Library/LaunchDaemons/com.apple.syslogd.plist
The next step is to configure your DrayTek router. Under System Maintenance >> SysLog / Mail Alert Setup check the "Enable" box and enter the ip address of your Mac under "Server IP address". The standard port 514 should not be altered. You can choose which events your router should forward to the syslog server. For initial testing leave all events checked. Click on "OK" and open up the Console app on your Mac. Navigate to your router.log on the left side. After a while you should see some entries.
Have fun...
thank you for writing this up!
AntwortenLöschenI have problems to read out the router.log file, because it is empty. Should I change the port from 512 to 1024 ?
AntwortenLöschenBecause I am not familiar with tcpdump, I did not get any further info out of this dump. What's the problem with local1 or local2 ?
My iMac has the IP 192.168.3.10
Here part out the dump :
ADCT-iMac:~ root# tcpdump -vv -i en0 port 514
tcpdump: listening on en0, link-type EN10MB (Ethernet), capture size 65535 bytes
08:43:36.017663 IP (tos 0x0, ttl 255, id 28895, offset 0, flags [none], proto UDP (17), length 144)
vigor.router.syslog > 192.168.3.10.syslog: [udp sum ok] SYSLOG, length: 116
Facility local2 (18), Severity info (6)
Msg: Jan 27 08:42:55 ADCT-Router: Local User (MAC=C8-2A-14-22-27-E2): 192.168.3.10:49774 -> 192.168.10.10:389 (TCP)
0x0000: 3c31 3530 3e4a 616e 2032 3720 3038 3a34
0x0010: 323a 3535 2041 4443 542d 526f 7574 6572
0x0020: 3a20 4c6f 6361 6c20 5573 6572 2028 4d41
0x0030: 433d 4338 2d32 412d 3134 2d32 322d 3237
0x0040: 2d45 3229 3a20 3139 322e 3136 382e 332e
0x0050: 3130 3a34 3937 3734 202d 3e20 3139 322e
0x0060: 3136 382e 3130 2e31 303a 3338 3920 2854
0x0070: 4350 2920
08:43:36.018223 IP (tos 0x0, ttl 255, id 28896, offset 0, flags [none], proto UDP (17), length 143)
vigor.router.syslog > 192.168.3.10.syslog: [udp sum ok] SYSLOG, length: 115
Thanks in advance for any help