Projet

Général

Profil

IPTables » Historique » Version 24

Laurent GUERBY, 25/08/2014 19:30

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 24 Laurent GUERBY
Avec PUB_IP = ip publique sur le host, LXC_IP l'ip privee de la VM, PORT_LIST = 80,443 (et d'autres) la liste des ports a transferer a la VM
33 22 Laurent GUERBY
34 22 Laurent GUERBY
<pre>
35 24 Laurent GUERBY
iptables -t nat -A PREROUTING -d ${PUB_IP}/32  -p tcp -m multiport --dports ${PORT_LIST} -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 24 Laurent GUERBY
iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -d ${LXC_IP}/32  -p tcp -m multiport --dports ${PORT_LIST} -j MASQUERADE
38 24 Laurent GUERBY
iptables -t nat -A OUTPUT -d ${PUB_IP} -p tcp -m multiport --dports ${PORT_LIST}  -j DNAT --to-destination ${LXC_IP}
39 22 Laurent GUERBY
</pre>
40 7 Laurent GUERBY
41 2 Laurent GUERBY
h1. ebtables
42 2 Laurent GUERBY
43 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
44 9 Laurent GUERBY
45 2 Laurent GUERBY
* http://serverfault.com/questions/284290/two-dhcp-servers-block-clients-for-one-of-them
46 5 Laurent GUERBY
47 5 Laurent GUERBY
ebtables -A INPUT --in-interface br0 --protocol ipv4 --ip-protocol udp --ip-source-port 67:68 -j DROP
48 5 Laurent GUERBY
ebtables -A INPUT --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-destination-port 67:68 -j DROP
50 5 Laurent GUERBY
ebtables -A FORWARD --in-interface br0 --protocol ipv4 --ip-protocol udp --ip-source-port 67:68 -j DROP
51 8 Laurent GUERBY
52 8 Laurent GUERBY
h1. ipset
53 8 Laurent GUERBY
54 8 Laurent GUERBY
http://ipset.netfilter.org/