Project

General

Profile

IPTables » History » Version 24

« Previous - Version 24/31 (diff) - Next » - Current version
Laurent GUERBY, 08/25/2014 07:30 PM


IPTables

iptables links

DHCP ?
sysctl -w net.bridge.bridge-nf-call-iptables=1
sysctl -w net.bridge.bridge-nf-call-ip6tables=1
iptables -A INPUT -p udp --sport 68 --dport 67 -j DROP

https://bugzilla.redhat.com/show_bug.cgi?id=512206

iptables hairpin

Hair pin / hairpin / hairpinning / NAT reflection

http://serverfault.com/questions/205040/accessing-the-dnatted-webserver-from-inside-the-lan

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

iptables -t nat -A PREROUTING -d ${PUB_IP}/32  -p tcp -m multiport --dports ${PORT_LIST} -j DNAT --to-destination ${LXC_IP}
iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -d ${LXC_IP}/32  -p tcp -m multiport --dports ${PORT_LIST} -j MASQUERADE
iptables -t nat -A OUTPUT -d ${PUB_IP} -p tcp -m multiport --dports ${PORT_LIST}  -j DNAT --to-destination ${LXC_IP}

ebtables

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

ebtables -A INPUT --in-interface br0 --protocol ipv4 --ip-protocol udp --ip-source-port 67:68 -j DROP
ebtables -A INPUT --in-interface br0 --protocol ipv4 --ip-protocol udp --ip-destination-port 67:68 -j DROP
ebtables -A FORWARD --in-interface br0 --protocol ipv4 --ip-protocol udp --ip-destination-port 67:68 -j DROP
ebtables -A FORWARD --in-interface br0 --protocol ipv4 --ip-protocol udp --ip-source-port 67:68 -j DROP

ipset

http://ipset.netfilter.org/