filmov
tv
LXC Containers - Exposing Ports & Port Forwarding

Показать описание
I sort of promised to make a networking port-forward video about LXC in my previous LXC & LXD video so, here it is!
Networking can be somewhat of a challenge in LXC. The (current) default use case for LXC & LXD is for use as internal containers in a virtual network. As such, you cannot easily port forward your containers as you can with Docker. Instead, you must change the nictype to make your containers publicly accessible. A side effect of this is since the container is no longer in a virtual network with the host, the host must use the router to connect to it.
Port forwarding can technically be achieved by using iptables, however, I think most people agree that iptables are cumbersome and are generally avoided by most users. Macvlan is a heavy-handed approach the technically exposes *all* ports to the router, which means you *must* have some kind of a firewall on your router or gateway if you want to keep your containers secured.
If you want to use your LXC container as a web server or game server (like I do), macvlan is arguably the best way to facilitate it.
~~
Support the channel! Becoming a Patron or Ko-fi supporter gives you access to the Egee video archive & good vibes for supporting my videos!
Use My Affiliate Links & Support The Channel! 🎁
Linux & Open Source Gear
Recording Gear
Networking can be somewhat of a challenge in LXC. The (current) default use case for LXC & LXD is for use as internal containers in a virtual network. As such, you cannot easily port forward your containers as you can with Docker. Instead, you must change the nictype to make your containers publicly accessible. A side effect of this is since the container is no longer in a virtual network with the host, the host must use the router to connect to it.
Port forwarding can technically be achieved by using iptables, however, I think most people agree that iptables are cumbersome and are generally avoided by most users. Macvlan is a heavy-handed approach the technically exposes *all* ports to the router, which means you *must* have some kind of a firewall on your router or gateway if you want to keep your containers secured.
If you want to use your LXC container as a web server or game server (like I do), macvlan is arguably the best way to facilitate it.
~~
Support the channel! Becoming a Patron or Ko-fi supporter gives you access to the Egee video archive & good vibes for supporting my videos!
Use My Affiliate Links & Support The Channel! 🎁
Linux & Open Source Gear
Recording Gear
Комментарии