Anonymous
Not logged in
Talk
Contributions
Create account
Log in
LinuxizeNet
Search
Editing
Linux router with WAN, LAN and DMZ
(section)
From LinuxizeNet
Namespaces
Page
Discussion
More
More
Page actions
Read
Edit
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Publish the DMZ servers (DNAT) === <code>25</code> is plain SMTP with STARTTLS, <code>587</code> is the submission port (also STARTTLS) and <code>465</code> is implicit TLS submission. Drop whichever of the two submission ports your mail server does not offer. <syntaxhighlight lang="bash"> # Mail -> 10.0.0.10 iptables -t nat -A PREROUTING -i eth0 -p tcp -m multiport \ --dports 25,465,587,993 -j DNAT --to-destination 10.0.0.10 # Web -> 10.0.0.20 iptables -t nat -A PREROUTING -i eth0 -p tcp -m multiport \ --dports 80,443 -j DNAT --to-destination 10.0.0.20 </syntaxhighlight> DNAT only rewrites the destination. The packet still has to survive <code>FORWARD</code>, which is where the matching accepts belong: <syntaxhighlight lang="bash"> iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT iptables -A FORWARD -m conntrack --ctstate INVALID -j DROP iptables -A FORWARD -i eth0 -o eth2 -d 10.0.0.10 -p tcp -m multiport \ --dports 25,465,587,993 -j ACCEPT iptables -A FORWARD -i eth0 -o eth2 -d 10.0.0.20 -p tcp -m multiport \ --dports 80,443 -j ACCEPT </syntaxhighlight>
Summary:
Please note that all contributions to LinuxizeNet may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
LinuxizeNet:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Wiki tools
Wiki tools
Special pages
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs