FreeKB - Firewalld firewall-cmd - bind an ethernet interface to a zone
Firewalld - firewall-cmd - bind an ethernet interface to a zone

If you are not familar with firewalld and the firewall-cmd, check out our Getting Started article.

The --add-interface option can be used to bind an interface to a zone. In this example, eth0 is bound to the public zone.

firewall-cmd --zone=public --add-interface eth0 --permanent
firewall-cmd --reload

 

The --remove-interface option can be used to remove an interface from a zone.

firewall-cmd --zone=public --remove-interface eth0 --permanent
firewall-cmd --reload

 

The --list-interfaces option can be used to display the interfaces a zone is bound to.

~]# firewall-cmd --zone public --list-interfaces
eth0

 

Or, the --list-all can be used.

~]# firewall-cmd --list-all
public
  target: default
  icmp-block-inversion: no
  interfaces: eth0
  sources:
  services: smtp
  ports:
  protocols:
  masquerade: no
  forward-ports:
  sourceports:
  icmp-blocks:
  rich rules:

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter 7d01f in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |