Linux Firewalls: Enhancing Security with nftables and Beyond by Steve Suehring
Author:Steve Suehring [Suehring, Steve]
Language: eng
Format: azw3, pdf
Publisher: Pearson Education
Published: 2015-01-22T16:00:00+00:00
NAT Semantics with iptables and nftables
Both iptables and nftables provide full NAT functionality, including both source (SNAT) and destination (DNAT) address mapping. The term full NAT isn’t a formal term; I’m referring to the capability to perform both source and destination NAT, to specify one or a range of translation addresses, to perform port translation, and to perform port remapping.
A partial implementation of NAPT, known as “masquerading” among Linux users, was provided in earlier Linux releases. It was used to map all local, private addresses to the single public IP address of the site’s single public network interface.
NAT and forwarding were often spoken of as two components of the same thing because masquerading was specified as part of the FORWARD rule’s semantics. Blurring the concepts was irrelevant functionally. Now it’s very important to keep the distinction in mind. Forwarding and NAT are two distinct functions and technologies.
Forwarding is routing traffic between networks. Forwarding routes traffic between network interfaces as is. Connections can be forwarded in either direction.
Masquerading sits on top of forwarding as a separate kernel service. Traffic is masqueraded in both directions, but not symmetrically. Masquerading is unidirectional. Only outgoing connections can be initiated. As traffic from local machines passes through the firewall to a remote location, the internal machine’s IP address and source port are replaced with the address of the firewall machine’s external network interface and a free source port on the interface. The process is reversed for incoming responses. Before the packet is forwarded to the internal machine, the firewall’s destination IP address and port are replaced with the real IP address and port of the internal machine participating in the connection. The firewall machine’s port determines whether incoming traffic, all of which is addressed to the firewall machine, is destined to the firewall machine itself or to a particular local host.
The semantics of forwarding and NAT are separated in iptables. The function of forwarding the packet is done in the filter table using the FORWARD chain. The function of applying NAT to the packet is done in the nat table, using one of the nat table’s POSTROUTING, PREROUTING, or OUTPUT chains:
Forwarding is a routing function. The FORWARD chain is part of the filter table.
NAT is a translation function that is specified in the nat table. NAT takes place either before or after the routing function. The nat table’s POSTROUTING, PREROUTING, and OUTPUT chains are part of the nat table. Source NAT is applied on the POSTROUTING chain after a packet has passed through the routing function. Source NAT is also applied on the OUTPUT chain for locally generated, outgoing packets. (The filter table OUTPUT chain and the nat table OUTPUT chain are two separate, unrelated chains.) Destination NAT is applied on the PREROUTING chain before passing the packet to the routing function.
Download
Linux Firewalls: Enhancing Security with nftables and Beyond by Steve Suehring.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7652)
Filmora Efficient Editing by Alexander Zacharias(4941)
The Infinite Retina by Robert Scoble Irena Cronin(4384)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3802)
Learn Wireshark - Fundamentals of Wireshark. by Lisa Bock(3432)
Edit Like a Pro with iMovie by Regit(2954)
Linux Administration Best Practices by Scott Alan Miller(2762)
Linux Command Line and Shell Scripting Techniques by Vedran Dakic & Jasmin Redzepagic(2741)
MCSA Windows Server 2016 Study Guide: Exam 70-740 by William Panek(2427)
Docker on Windows by Stoneman Elton(2228)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2212)
Hands-On AWS Penetration Testing with Kali Linux by Karl Gilbert(2015)
Mastering PowerShell Scripting - Fourth Edition by Chris Dent(1932)
Hands-On Linux for Architects by Denis Salamanca(1926)
Computers For Seniors For Dummies by Nancy C. Muir(1900)
Programming in C (4th Edition) (Developer's Library) by Stephen G. Kochan(1875)
The Old New Thing by Raymond Chen(1844)
Creative Projects for Rust Programmers by Carlo Milanesi(1729)
Linux Kernel Debugging by Kaiwan N Billimoria(1676)
