Projet

Général

Profil

IPTables » Historique » Version 22

Laurent GUERBY, 25/08/2014 18:59

1 1 Laurent GUERBY
{{>toc}}
2 1 Laurent GUERBY
3 1 Laurent GUERBY
h1. IPTables
4 1 Laurent GUERBY
5 22 Laurent GUERBY
h2. iptables links
6 22 Laurent GUERBY
7 1 Laurent GUERBY
* http://www.bortzmeyer.org/dns-netfilter-u32.html
8 1 Laurent GUERBY
* http://www.stearns.org/doc/iptables-u32.current.html
9 1 Laurent GUERBY
* http://ebtables.sourceforge.net/br_fw_ia/PacketFlow.png
10 1 Laurent GUERBY
* http://ebtables.sourceforge.net/
11 6 Laurent GUERBY
* http://www.inetdoc.net/guides/iptables-tutorial/traversingoftables.html
12 11 Laurent GUERBY
* http://upload.wikimedia.org/wikipedia/commons/3/37/Netfilter-packet-flow.svg
13 10 Laurent GUERBY
* https://en.wikipedia.org/wiki/List_of_router_or_firewall_distributions
14 2 Laurent GUERBY
15 2 Laurent GUERBY
DHCP ?
16 3 Laurent GUERBY
sysctl -w net.bridge.bridge-nf-call-iptables=1 
17 3 Laurent GUERBY
sysctl -w net.bridge.bridge-nf-call-ip6tables=1 
18 3 Laurent GUERBY
iptables -A INPUT -p udp --sport 68 --dport 67 -j DROP
19 2 Laurent GUERBY
20 4 Laurent GUERBY
https://bugzilla.redhat.com/show_bug.cgi?id=512206
21 4 Laurent GUERBY
22 7 Laurent GUERBY
* libnml
23 7 Laurent GUERBY
** http://www.spinics.net/lists/netfilter/msg52868.html
24 7 Laurent GUERBY
** http://1984.lsi.us.es/~pablo/docs/spae.pdf
25 22 Laurent GUERBY
26 22 Laurent GUERBY
h2. iptables hairpin
27 22 Laurent GUERBY
28 22 Laurent GUERBY
Hair pin / hairpin / hairpinning / NAT reflection
29 22 Laurent GUERBY
30 22 Laurent GUERBY
http://serverfault.com/questions/205040/accessing-the-dnatted-webserver-from-inside-the-lan
31 22 Laurent GUERBY
32 22 Laurent GUERBY
Avec PUB_IP = ip publique sur le host, et LXC_IP l'ip privee de la VM
33 22 Laurent GUERBY
34 22 Laurent GUERBY
<pre>
35 22 Laurent GUERBY
iptables -t nat -A PREROUTING -d ${PUB_IP}/32  -p tcp -m multiport --dports 80,443 -j DNAT --to-destination ${LXC_IP}
36 22 Laurent GUERBY
iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -o eth0 -j MASQUERADE
37 22 Laurent GUERBY
iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -d ${LXC_IP}/32  -p tcp -m multiport --dports 80,443 -j MASQUERADE
38 22 Laurent GUERBY
</pre>
39 7 Laurent GUERBY
40 2 Laurent GUERBY
h1. ebtables
41 2 Laurent GUERBY
42 9 Laurent GUERBY
ebtables -A FORWARD -d ff:ff:ff:ff:ff:ff/ff:ff:ff:ff:ff:ff -p IPv4 --ip-prot udp --ip-dport 67:68 -j DROP
43 9 Laurent GUERBY
44 2 Laurent GUERBY
* http://serverfault.com/questions/284290/two-dhcp-servers-block-clients-for-one-of-them
45 5 Laurent GUERBY
46 5 Laurent GUERBY
ebtables -A INPUT --in-interface br0 --protocol ipv4 --ip-protocol udp --ip-source-port 67:68 -j DROP
47 5 Laurent GUERBY
ebtables -A INPUT --in-interface br0 --protocol ipv4 --ip-protocol udp --ip-destination-port 67:68 -j DROP
48 5 Laurent GUERBY
ebtables -A FORWARD --in-interface br0 --protocol ipv4 --ip-protocol udp --ip-destination-port 67:68 -j DROP
49 5 Laurent GUERBY
ebtables -A FORWARD --in-interface br0 --protocol ipv4 --ip-protocol udp --ip-source-port 67:68 -j DROP
50 8 Laurent GUERBY
51 8 Laurent GUERBY
h1. ipset
52 8 Laurent GUERBY
53 8 Laurent GUERBY
http://ipset.netfilter.org/