iptables -t nat -A POSTROUTING -s 10.10.10.2 -o eth1 -j MASQUERADE Or, if you have multiple PC-s, use a subnet mask and allow access for the whole network: iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o eth1 -j MASQUERADE

For example, if you don't want to map anything over 1.2.3.5, you could do: # iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth1 \ -j SNAT --to 1.2.3.0-1.2.3.4 --to 1.2.3.6-1.2.3.254 Altering the Destination of Locally-Generated Connections SNATs and DNATs - Jeff Silverman's web page By way of contrast, a DNAT allows any host on the “outside” to get to a single host on the “inside”. For example, suppose we have a SNAT with IP address 192.168.14.3 and destination IP address 216.39.144.116. Suppose a host on the “inside” with IP address 192.168.14.83 wishes to connect to the www.yahoo.com. Linux iptables delete prerouting rule command - nixCraft Feb 18, 2020 ebtables – Basic examples For more information about the various commands and options used in these examples, we refer to the manual page. ff iptables -t nat -A PREROUTING -j DNAT --to-destination 192.168.0.255 The bridge device should not have an address in the range of 192.168.0.0/24, because if it does, the routing code won't decide to send the packet out through

Iptables Essentials: Common Firewall Rules and Commands

Aug 10, 2015 · For example, if you want to allow the entire 15.15.15.0/24 subnet to be able to rsync to your server, run these commands: sudo iptables -A INPUT -p tcp -s 15.15.15.0/24--dport 873 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT sudo iptables -A OUTPUT -p tcp --sport 873 -m conntrack --ctstate ESTABLISHED -j ACCEPT

May 05, 2017

Basic iptables template for ordinary servers (both IPv4 # Basic iptables/IPv4 template for an ordinary servers # # This file is in iptables-restore format. See the man pages for # iptables-restore(8) and iptables-save(8). # # The following is a set of firewall rules that should be applicable to Linux # servers running within departments. It is intended to provide a useful Advanced Features of netfilter/iptables LG #108 Advanced Features of netfilter/iptables. By Barry O'Donovan. Introduction It is commonly known that netfilter/iptables is the firewall of the Linux operating system. What is not commonly known is that iptables has many hidden gems that can allow you do things … Nftables/Examples - Gentoo Wiki On this page several example nftable configurations can be found. The first two examples are skeletons to illustrate how nftables works. The third and fourth exmaple show how, using nftables, rules can be simplified by combining IPv4 and IPv6 in the generic IP table 'inet'. The fifth example shows how nftables can be combined with bash scripting. What is difference between SNAT and DNAT? - Quora