<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="lt">
	<id>https://wiki.eofnet.lt/w//index.php?action=history&amp;feed=atom&amp;title=Iptables</id>
	<title>Iptables - Versijų istorija</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.eofnet.lt/w//index.php?action=history&amp;feed=atom&amp;title=Iptables"/>
	<link rel="alternate" type="text/html" href="https://wiki.eofnet.lt/w//index.php?title=Iptables&amp;action=history"/>
	<updated>2026-04-19T09:05:43Z</updated>
	<subtitle>Šio puslapio versijų istorija projekte</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.eofnet.lt/w//index.php?title=Iptables&amp;diff=9567&amp;oldid=prev</id>
		<title>\dev\null 08:54, 23 liepos 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.eofnet.lt/w//index.php?title=Iptables&amp;diff=9567&amp;oldid=prev"/>
		<updated>2023-07-23T08:54:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;lt&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Ankstesnė versija&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;08:54, 23 liepos 2023 versija&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l60&quot; &gt;60 eilutė:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;60 eilutė:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  iptables -t nat $exp PREROUTING -p tcp -i br0 --dport 85 -j DNAT --to-destination 192.168.1.51:80&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  iptables -t nat $exp PREROUTING -p tcp -i br0 --dport 85 -j DNAT --to-destination 192.168.1.51:80&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  iptables -t nat $exp POSTROUTING -d 192.168.1.51 -p tcp --dport 80 -j SNAT --to-source 192.168.1.101&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  iptables -t nat $exp POSTROUTING -d 192.168.1.51 -p tcp --dport 80 -j SNAT --to-source 192.168.1.101&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== ISP Limitų apėjimas ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Veikia su 4G LTE.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; iptables -t mangle -I POSTROUTING -o $(get_wanface) -j TTL --ttl-set 65 &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; iptables -t mangle -I PREROUTING -i $(get_wanface) -j TTL --ttl-set 65&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Kiti įrankiai:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Kiti įrankiai:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>\dev\null</name></author>
	</entry>
	<entry>
		<id>https://wiki.eofnet.lt/w//index.php?title=Iptables&amp;diff=8534&amp;oldid=prev</id>
		<title>\dev\null: /* Porto nukreipimas i kita hosta */</title>
		<link rel="alternate" type="text/html" href="https://wiki.eofnet.lt/w//index.php?title=Iptables&amp;diff=8534&amp;oldid=prev"/>
		<updated>2017-11-05T09:41:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Porto nukreipimas i kita hosta&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Naujas puslapis&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Network Address Translation (NAT) ==&lt;br /&gt;
&lt;br /&gt;
NAT - daugiau žinomas kaip interneto dalinimas vidinio tinklo kompiuteriams kurie stovi už linux serverio/firewallo&lt;br /&gt;
&lt;br /&gt;
* '''eth0''' - Išorinis interfeisas&lt;br /&gt;
* '''eth1''' - Vidinis interfeisas kuriam norite duoti internetą&lt;br /&gt;
&lt;br /&gt;
 iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE&lt;br /&gt;
 iptables --append FORWARD --in-interface eth1 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
== Port Forward ==&lt;br /&gt;
&lt;br /&gt;
* '''XX.XX.XX.XX''' - Išorinis IP&lt;br /&gt;
* '''YY.YY.YY.YY''' - Vidinis IP&lt;br /&gt;
* '''eth0''' - Išorinis interfeisas&lt;br /&gt;
* '''PORT''' - Portas&lt;br /&gt;
* '''tcp''' - Protokolas, norint galima jį pakeisti į udp&lt;br /&gt;
&lt;br /&gt;
=== Vieno porto ===&lt;br /&gt;
 iptables -t nat -A PREROUTING -p tcp -i eth0 -d XX.XX.XX.XX --dport PORT -j DNAT --to YY.YY.YY.YY:PORT&lt;br /&gt;
 iptables -A FORWARD -p tcp -i eth0 -d YY.YY.YY.YY --dport PORTAS -j ACCEPT&lt;br /&gt;
=== Keletos portu ===&lt;br /&gt;
 iptables -A FORWARD -d YY.YY.YY.YY -i eth0 -p tcp -m tcp --dport 4400:5000 -j ACCEPT&lt;br /&gt;
 iptables -t nat -A PREROUTING -p tcp -i eth0 -d YY.YY.YY.YY --dport 4400:5000 -j DNAT --to-destination XX.XX.XX.XX&lt;br /&gt;
 iptables -A FORWARD -d YY.YY.YY.YY -i eth0 -p udp -m udp --dport 4400:5000 -j ACCEPT&lt;br /&gt;
 iptables -t nat -A PREROUTING -p udp -i eth0 -d YY.YY.YY.YY --dport 4400:5000 -j DNAT --to-destination XX.XX.XX.XX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Porto redirectinimas į kitą ==&lt;br /&gt;
Lokalioj mašinoj arba visokiuose vnetuose*&lt;br /&gt;
 iptables -t nat -A PREROUTING -p tcp --dport 2525 -j REDIRECT --to-ports 25&lt;br /&gt;
&lt;br /&gt;
== Įeinančio IP blokavimas ==&lt;br /&gt;
&lt;br /&gt;
* '''-s''' - Source IP&lt;br /&gt;
* '''XX.XX.XX.XX''' - Blokuojamas IP&lt;br /&gt;
&lt;br /&gt;
iptables -A INPUT -s XX.XX.XX.XX -j DROP&lt;br /&gt;
&lt;br /&gt;
== Tam tikrų įeinančių IP įleidimas pagal portą ==&lt;br /&gt;
&lt;br /&gt;
 iptables -I INPUT -p tcp -d $server_ip --dport $port -j DROP&lt;br /&gt;
 iptables -I INPUT -s $client -d $server_ip -p tcp --dport $port -j ACCEPT&lt;br /&gt;
 iptables -I INPUT -s $client2 -d $server_ip -p tcp --dport $port -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
== Loginimas ==&lt;br /&gt;
Naudojam /var/log/iptables.log kaip loga ir rsyslog kaip syslog'a&lt;br /&gt;
&lt;br /&gt;
Kuriam failą '''/etc/rsyslog.d/iptables.conf'''&lt;br /&gt;
Į jį rašom:&lt;br /&gt;
 :msg,contains,&amp;quot;[netfilter] &amp;quot; /var/log/iptables.log&lt;br /&gt;
Tada nustatom kurį iptables chain'ą loginsim pvz '''FORWARD''' arba '''INPUT''' ir t.t&lt;br /&gt;
tada nustatom taisyklę&lt;br /&gt;
 # iptables -A &amp;lt;chainas&amp;gt; -m limit --limit 1/sec --limit-burst 2 -j LOG --log-prefix='[netfilter] ' --log-level 6 --log-tcp-options&lt;br /&gt;
Perkraunam rsyslog...&lt;br /&gt;
&lt;br /&gt;
== Porto nukreipimas i kita hosta ==&lt;br /&gt;
85 porta nukreipiam i 80 192.168.1.51 hosto.&lt;br /&gt;
 echo 1 &amp;gt;| /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
 iptables -t nat $exp PREROUTING -p tcp -i br0 --dport 85 -j DNAT --to-destination 192.168.1.51:80&lt;br /&gt;
 iptables -t nat $exp POSTROUTING -d 192.168.1.51 -p tcp --dport 80 -j SNAT --to-source 192.168.1.101&lt;br /&gt;
&lt;br /&gt;
Kiti įrankiai:&lt;br /&gt;
* http://www.vanimpe.eu/2014/04/21/ulogd-viz-visualize-iptables-netfilter-ufw-logs/&lt;br /&gt;
* http://tud.at/programm/fwanalog/&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:CentOS]]&lt;br /&gt;
[[Category:Gentoo]]&lt;br /&gt;
[[Category:Slackware]]&lt;br /&gt;
[[Category:Ubuntu]]&lt;br /&gt;
[[Category:Archlinux]]&lt;br /&gt;
[[Category:Tinklas]]&lt;/div&gt;</summary>
		<author><name>\dev\null</name></author>
	</entry>
</feed>