Hi every one !
I get it !! I get it finally !!
Finally I get how we can do internet kill switch from firewalld !!
Follow this guide that I clarified & modified it & made it easy & more global than original one:
Warning !! Warning !! This guide only valid on DEFAULT zone that created by developer of firewalld & NOT APPLIED on user created zone. If you apply it on user created zone, you will loss ability to connect to internet totally from any zone & can not restore your internet connection unless by undo (remove) all rules of this guid from user created zone that you added them to it !!
Internet Kill Switch by Firewalld:
1. establish your VPN connection 1st (VERY IMPORTANT STEP)
2. Now, using terminal, configure your runtime rules as following, one by one:
sudo firewall-cmd --direct --add-rule ipv4 filter FORWARD 0 -o tun+ -j ACCEPT
sudo firewall-cmd --direct --add-rule ipv4 filter FORWARD 0 -i tun+ -j ACCEPT
sudo firewall-cmd --direct --add-rule ipv6 filter INPUT 0 -j DROP
sudo firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -i lo -j ACCEPT
sudo firewall-cmd --direct --add-rule ipv4 filter INPUT 1 -i tun+ -p udp --dport 443 -j ACCEPT
sudo firewall-cmd --direct --add-rule ipv4 filter INPUT 999 -j DROP
sudo firewall-cmd --direct --add-rule ipv6 filter OUTPUT 0 -j DROP
sudo firewall-cmd --direct --add-rule ipv4 filter OUTPUT 0 -o lo -j ACCEPT
sudo firewall-cmd --direct --add-rule ipv4 filter OUTPUT 0 -o tun+ -j ACCEPT
sudo firewall-cmd --direct --add-rule ipv4 filter OUTPUT 1 -p udp -m udp --dport 443 -j ACCEPT
sudo firewall-cmd --direct --add-rule ipv4 filter OUTPUT 999 -j DROP
(Command line in blue is optional. It allow incoming flow through VPN [NOT RECOMMENDED: LESS SECURE]. However, it is useful if you like to use torrent during your VPN session.)
(The items marked by RED COLOUR must be exactly the same that used in your VPN configuration files. I used totally different parameters & it works !!!)
4. To disable internet kill switch, YOU MUST REBOOT YOUR PC. Reloading firewalld will not disable Internet kill switch !!!
(If internet kill switch remain enabled, you can not neither brows internet using non-VPN connection nor establish new VPN connection.)
--------------------------------------------
Original source here:
https://airvpn.org/topic/15061-firewalld-killswitch/
Do not follow the original source. No need to add any IP address. Just apply my guide.
Do not use "--permanent" because I do not know how to undo the changes & if also you do not know, then you will never be able to disable internet kill switch &, thus, you will never be able to connect to internet again ! If some one know how to revert these changes (if we use '--permanent' ) then please kindly explain how.
Please notice that this guide give you not only VPN Internet Kill Switch, but also IPv6 leak protection !!
Please your examination & conformation about correctness of my guide.
Bset