Access NVR from the internet with Mikrotik port forwarding

I had to set up access to a Hikvision NVR on local network. Port forward from the public IP of ISP was done. My job was setting port forwarding on Mikrotik router which was connected to the NVR.

It was a lot of hours wasted until I figured it out from lots of forum reading and YouTube videos watching 😀

/ip firewall filter
add action=dst-nat chain=dstnat dst-address= dst-port=58000 \
    protocol=tcp to-addresses= to-ports=8000
add action=dst-nat chain=dstnat dst-address= dst-port=56911 \
    log=yes protocol=tcp to-addresses= to-ports=6911

The dst-address had to be the IP address of the router from the WAN side. Check in Quick Set

Mikrotik NAT port fowarding


Hikvision NVR camera stream watching on LG TV

LG Smart World contains the Smart IPTV app

What’s needed is creating a m3u playlist file with the RTSP stream URLs

#EXTINF:0,group-title="Kamera",Hatso resz

The m3u file can be uploaded via You could upload it on a shared web hosting or on your own public web server that can realtime provide updated m3u file.

Installing Plex Media Server on a remote host

Finally nailed it. I installed Plex Media Server on a remote host and after visiting the http://REMOTE_HOST_IP:32400/web I had no add server option.

In a forum thread I found the add server URL part, just add #!/setup http://raspi:32400/web/index.html#!/setup
But I got Setup is not allowed for shared servers. error

Setup is not allowed for shared servers.

I ended up with port forwarding to the remote host
ssh -L 32400:raspi:32400

To be able to add server I had to connect to localhost http://localhost:32400/web/index.html#!/setup

Plex media server setup wizard

More info about troubleshooting remote access is at

Traefik test drive Docker container discovery

Simple config for testing Traefik with Docker:

# traefik.toml
debug = true

entryPoint = 'traefik'
debug = true

endpoint = 'unix:///var/run/docker.sock'
domain = 'docker.localhost'
watch = true

Run Traefik in a docker container:

docker run --rm -l traefik -p 8080:8080 -p 80:80 \
    -v $PWD/traefik.toml:/etc/traefik/traefik.toml \
    -v /var/run/docker.sock:/var/run/docker.sock traefik

Fire up one docker compose setup and visit http://localhost:8080

Dual monitor Awesome WM with xrandr

I struggled a couple of days until I figured it out that setting up dual monitor via xrandr is needed after X started and before aweome started, so in between.

The solution was adding xrandr exec line into my .xinitrc

# ~/.xinitrc
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

function VGAConnected {
   ! xrandr | grep "^VGA-1" | grep disconnected
if VGAConnected; then
    xrandr --output eDP-1-1 --mode 1920x1080 --primary \
           --output VGA-1-1 --mode 1920x1080 --rotate normal --right-of eDP-1-1

exec awesome -c .config/awesome/rc.lua

to get the screen names (eDP-1-1, VGA-1-1, etc.) just run xrandr without args.