Skip to main content

Posts

Showing posts with the label nat

Setting up wireguard

 Time has come to explore a new (well, it's not that new anymore, it was introduced in kernel 5.6) VPN technology that is more lightweight and faster on single-board computers (SBCs) than something like OpenVPN. I'm talking about Wireguard . The key takeaways for why Wireguard might be better than other VPN technologies (like OpenVPN, or IPSec) are: very small code, easier to audit runs in kernel space, not userspace  configuration can be done with standard linux tools (like ip, iproute, iptables), but there are some helper scripts that simplify setting up/starting up doesn't support cypher negotiation (thus preventing downgrade attacks) is quiet by default and doesn't reply to random packets from the Internet (difficult to scan for wireguard concentrators and try brute-force attacks) has better performance than userspace encryption (to be tested) All good network tutorials begin with a network diagram and end with a packet capture. So, let's say you want to host a ...

RTSP streaming over dual nat with RTSP Interleaved mode

I have an IP Camera that supports RTSP streaming (most IP cameras seem to support it - Axis, Edimax, etc). This allows you to view mpeg4 or h264 live streams either by using a proprietary ActiveX control (via their web interface) or via a RTSP client. If you are in the same LAN as the camera, you can easily connect to it by using VLC or even ffmpeg (to save or transcode the stream): vlc rtsp://192.168.1.10/ipcamera_h264.sdp ffmpeg -i rtsp://192.168.1.10/ipcamera_h264.sdp test.ts ffmpeg -i rtsp://192.168.1.10/ipcamera_h264.sdp -f mpegts | vlc - The problem is if you want to access that camera over the Internet. RTSP usually transports the data over UDP and negotiates the UDP ports over a control session on port 554 TCP. This gets difficult if you use NAT at either end or if you have firewalls you need to get through. Let's consider this typical scenario: The packets need to go through 2 NATs to travel between the source and destination. To make this happen, y...