The Linux network has gone through several generations of development. Now you need to use the ip
utility to set up connections and all sorts of checks. Some others like ifconfig
, route
(although the Internet is full of instructions on how to use them) are no longer worth it. A good video on this topic (iproute2): https://www.youtube.com/watch?v=lKgqpYs14Ss&list=PLnOsFlFEJ4s2ZeK8AWX4cCNqPs43RtNXT&index=5&pp=gAQBiAQB . It is clear that this is about the core and the utilities for it. Distribution-specific configuration utilities (the same NetworkManager) – they can and should be used, but do not forget that this is just an add-on.
If it seemed too easy, then the text is about several routing tables (and why it is needed): https://timeweb.com/ru/community/articles/nastroyka-neskolkih-tablic-marshrutizacii-na-odnom-servere
Then we have traffic, but we want to do something strange (port forwarding / NAT) or set filtering rules (firewall), then we remember about iptables. A few videos to understand this topic as well:
- https://www.youtube.com/watch?v=7ql7SKpTRXA&list=PLnOsFlFEJ4s2ZeK8AWX4cCNqPs43RtNXT&index=8&pp=gAQBiAQB
- https://www.youtube.com/watch?v=Q0EC8kJlB64&list=PLnOsFlFEJ4s2ZeK8AWX4cCNqPs43RtNXT&index=7&pp=gAQBiAQB
- https://www.youtube.com/watch?v=u_a3ouarrVU&list=PLnOsFlFEJ4s2ZeK8AWX4cCNqPs43RtNXT&index=6&pp=gAQBiAQB
It would seem that’s all, nothing else is needed… but, iptables is already quite outdated. There is a generalizing replacement for it with a slightly nicer syntax: nf_tables (the main utility of nft
, but casino fans have ruined this abbreviation). Video how to deal with this (already knowing iptables): https://www.youtube.com/watch?v=XcILw0qFBLA&list=PLnOsFlFEJ4s2ZeK8AWX4cCNqPs43RtNXT&index=2&t=911s&pp=gAQBiAQB
And like the cherry on the cake – VPN. Take ipsec (strongwan). It adds its magic by default after the last stage of iptables. So it makes a lot of confusion if you suddenly want to adjust at least a little. Therefore, it is better to use the VTI (virtual tunnel interface) option: a virtual network interface is created and we can normally route and connect, at least a little less magic. Video:
- https://www.youtube.com/watch?v=nDzuStXOF3I&list=PLnOsFlFEJ4s2ZeK8AWX4cCNqPs43RtNXT&index=4&pp=gAQBiAQB (a bit of theory to sort out the terms and a lot of settings even in GUI tools)
- https://www.youtube.com/watch?v=eFlnffF1ZCI&list=PLnOsFlFEJ4s2ZeK8AWX4cCNqPs43RtNXT&index=3&t=1719s&pp=gAQBiAQB (there is only theory here, because practice is on cisco)
- https://www.youtube.com/watch?v=HDqAl_PozCU&list=PLnOsFlFEJ4s2ZeK8AWX4cCNqPs43RtNXT&index=1&t=633s&pp=gAQBiAQB (in English, but something was not found in Russian)
- https://selectel.ru/blog/tutorials/how-to-set-up-vpn-ipsec / (without introductory videos, you can customize, but half of it will still be unclear) It will not be a big surprise to learn that VTI is already obsolete and it is better to use XFRM.
Why such a long introduction? See the following note.