• iptables,  Linux

    IPTables tips

    Some tips for iptables   Listing nat rules iptables -t nat -v -L POSTROUTING -n --line-number Delete a certain rule iptables -t nat -D POSTROUTING (from https://www.cyberciti.biz/faq/how-to-iptables-delete-postrouting-rule/ ) Create a rule to redirect outgoing packets for a certain IP/port iptables -t nat -A PREROUTING -p tcp -d OLD_IP --dport 80 -j NETMAP --to NEW_IP (from https://linux-tips.com/t/rewriting-destination-ip-address/221)

  • CentOS,  Linux

    CentOS firewall-cmd tips

    Some tips for CentOS 7 firewall-cmd tool:   Allow openvpn firewall-cmd --zone=public --add-service openvpn --permanent firewall-cmd reload Add a rule firewall-cmd --zone=public --add-port=8080/tcp --permanent firewall-cmd reload