Delete Set public Set private Add tags Delete tags
  Add tag   Cancel
  Delete tag   Cancel
  • • DevOps notes •
  •  
  • AI
  • Tags
  • Login

Firewall/shaare/hJTVjQ

  • linux
  • linux

Enable firewall

  • firewall-config → GUI for options

    • add ports
  • firewall-cmd → CLI
  • cat /etc/sysconfig/iptables-config
  • cat /etc/firewalld/firewalld.conf

Firewall config

  • iptables = old, firewalld = new (use in all Linux distros)
  • Check iptables rules → iptables -L
  • Flush rules → iptables -F

Iptables packet filtering

  • Tables (process packets) → filter

    • attached to chains (inspect traffic)

    • INPUT → incoming traffic

    • FORWARD → going to router from another device

    • OUTPUT → outgoing traffic

  • Target (what happens when a rule is met)

    • ACCEPT
    • REJECT → send reject response
    • DROP → drop without response

Firewalld

  • firewall-cmd --list-all

    • check the rule
  • firewall-cmd --get-services

    • list service firewall is aware of
  • firewall-cmd --reload

    • reload for new rules
  • firewall-cmd --get-zones

    • get a list of all zones
    • public zone is used most of the time
  • firewall-cmd --get-actives-zones

    • get active zones
  • firewall-cmd --zone=public --list-all

    • get firewall rule for public zone

Add extra service:

  • cp /usr/lib/firewalld/services/allservices.xml

    • change service and port number
  • sap.xml → firewall-cmd --add-service=sap

  • firewall-cmd --add-service=http

    • add a service (http)
    • --permanent
  • firewall-cmd --remove-service=http

    • remove a service (http)
    • --permanent
  • firewall-cmd --reload

    • reload configuration
  • firewall-cmd --add-port=1110/tcp

    • add a port
    • --permanent
  • firewall-cmd --remove-port=1110/tcp

    • remove a port
    • --permanent
  • firewall-cmd --add-rich-rule='rule family="ipv4" source address="192.168.8.1" drop'

    • block certain IP address
  • firewall-cmd --add-icmp-block=ipv6-redirect

    • block ping
  • firewall-cmd --direct --add-rule ipv4 filter OUTPUT 0 -d 8.9.10.11 -j DROP

    • block website (host → www.website.com)
8 months ago Permalink
cluster icon
  • Tuned : Tweaks with Tuned / Podman Tweaks with Tuned systemctl enable tuned tuned-adm active check which profile is active tuned-adm list list all prof...
  • SSH and DNS : SSH ps -ef | grep sshd → check ssh systemctl status sshd DNS PTR record → IP to hostname A record → hostname to IP CNAME record → hostname to...
  • Special Permissions (SetUID, SetGID, Sticky Bit) : chmod u+s xyz.sh → add SetUID (user-level special permission) chmod g+s xyz.sh → add SetGID (group-level special permission) chmod u-s xyz.sh → remov...
  • Computer Storage / Disk Partition : Computer Storage Local → RAM / HDD / SSD DAS (Direct Attached Storage) USB HDD / DVD SAN (Storage Area Network) through iSCSI cable or fiber ...
  • Filesystem check and disk cloning : fsck & xfs_repair → filesystem check fsck → ext2, ext3, ext4 xfs_repair → xfs only Made each boot & fix it df -T → check Unmount before fsck ...


(97)
Filter untagged links
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community