Creating 1:1 NAT using iptables Rumi, June 8, 2024 Its a POC where I needed a 1:1 NAT using Linux iptables. I used 2 Debian 11 OS for this and here’s the machine IP plans- VM-1: IPTables/NAT Router- 123.45.67.5/24, 123.45.67.6/24 and 192.168.10.5/24 VM-2: Backend Server- 192.168.10.6/24 (this VM’s gateway will be 192.168.10.5 On VM-1 Uninstall nftables and its Dependencies… Continue Reading
INSTALL IPTABLES IN DEBIAN 11 (BULLSEYE) Rumi, February 26, 2024February 26, 2024 In this article you will learn how to uninstall default nftables framework, install iptables Debian 11 (Bullseye) and basic rules initial configuration. Uninstall nftables and its Dependencies IPtables is being replaced by nftables starting with Debian 10 Buster. Debian 11 comes with nftables framework. To install iptables first we need uninstall nftables and its dependencies. SSH… Continue Reading
Enable IPTables on Rocky Linux 8 Rumi, September 2, 2023 Disabling firewalld You can’t really run the old iptables utilities alongside firewalld. They’re just not compatible. The best way to get around this is to disable firewalld entirely (no need to uninstall it unless you want to) , and reinstall the iptables utilities. Disabling firewalld can be done using these… Continue Reading
IPTables D-NAT Firewall Rule Rumi, September 2, 2023 # Generated by iptables-save v1.3.5 on Tue Oct 28 23:57:58 2014 *filter :INPUT ACCEPT [2590:547311] :FORWARD ACCEPT [11426:731834] :OUTPUT ACCEPT [3989:328501] -A INPUT -i eth0 -j ACCEPT COMMIT # Completed on Tue Oct 28 23:57:58 2014 # Generated by iptables-save v1.3.5 on Tue Oct 28 23:57:58 2014 *mangle :PREROUTING ACCEPT… Continue Reading
Flushing IPTables rule and allow all traffic for Debian or Ubuntu Rumi, March 20, 2023 Flushing all iptables chain rules shell script #!/bin/sh echo “Stopping IPv4 firewall and allowing everyone…” ipt=”/sbin/iptables” ## Failsafe – die if /sbin/iptables not found [ ! -x “$ipt” ] && { echo “$0: \”${ipt}\” command not found.”; exit 1; } $ipt -P INPUT ACCEPT $ipt -P FORWARD ACCEPT $ipt -P… Continue Reading
Postfix SMTP Rotating IP using IPTables Rumi, August 1, 2022 I got 5 Public IPs. i’m Gonna configure them, so Postfix can use multiple interfaces/ips for outgoing smtp connections. First we need creating Interface aliases for those 5 public IPs. In my system, using centos: # cd /etc/sysconfig/network-scripts/ # cp ifcfg-eth0 ifcfg-eth0:1 Edit ifcfg-eth0:1 # vi ifcfg-eth0\:1 DEVICE=eth0 <– default… Continue Reading
Install Iptables on CentOS 7 Rumi, April 23, 2020June 18, 2022 Disable FirewallD To disable the FirewallD on your CentOS 7 system, follow these steps: Type the following command to stop the FirewallD service: sudo systemctl stop firewalld Disable the FirewallD service to start automatically on system boot: sudo systemctl disable firewalld Mask the FirewallD service to prevent it from being… Continue Reading
Disable FirewallD and Enable Iptables on CentOS 7 Rumi, December 28, 2019 Download and Install the Iptables Service To begin your server’s transition, you need to download and install the iptables-service package from the CentOS repositories. Download and install the service files by typing: sudo yum install iptables-services This will download and install the systemd scripts used to manage the iptables service…. Continue Reading
Stateful Load Balancer with iptables and NAT Rumi, October 2, 2018October 2, 2018 Allow IP forwarding (Note: if your testing this on the same box your doing this on it won’t work, you need at least 3 machines to test this out, virtual ones work nicely) First we enable ipv4 forwarding or this will not work: # echo “1” > /proc/sys/net/ipv4/ip_forward XOR #… Continue Reading
NFS Firewall Rumi, September 9, 2015 Dynamic ports cannot be protected by port filtering firewalls such as iptables. First, you need to configure NFS services to use fixed ports. Open /etc/sysconfig/nfs, enter: # vi /etc/sysconfig/nfs Modify config directive as follows to set TCP/UDP unused ports: # TCP port rpc.lockd should listen on. LOCKD_TCPPORT=lockd-port-number # UDP port… Continue Reading