Permalänk
Medlem

Ipv6 + iptables

Hej

Jag tänkte sätta upp en ipv6 tunnel, men ja fick problem

jag fick detta när ja tänkte fixa tunneln från tunnelbroker

"Your IPv4 endpoint must be pingable. If you are blocking ICMP, please allow ipv6.he.net through your firewall. "

Och detta är mitt iptables script:

#SETTING UP IPTABLES
#!/bin/bash

INET_IF="eth0"
LAN_IF="eth1"

modprobe iptable_nat

# Sätt upp standardregler
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

# Rensa bort gamla brandväggsregler
iptables -F
iptables -t nat -F

# Rensa bort gamla kedjor
iptables -X

#Skapa en kedja logdrop för att logga och kasta trafik

iptables -N logdrop
iptables -A logdrop -j LOG
iptables -A logdrop -j DROP

# tillåt loopback pls
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

# tillåt utg. dns-reqar
iptables -A OUTPUT -p udp -o $INET_IF --dport 53 --sport 1024:65535 -j ACCEPT
iptables -A INPUT -p udp -i $INET_IF --sport 53 --dport 1024:65535 -j ACCEPT

#tillåt ipv6 tunnelbroker

iptables -A INPUT -p udp --source ipv6.he.net -j ACCEPT

#tillåt IPV6

iptables -A INPUT -i eth0 -p ipv6 -j ACCEPT

# tillåt inkommande

iptables -A INPUT -i $INET_IF -p tcp -s 0/0 --dport 35000:36000 -j ACCEPT

iptables -A INPUT -p tcp -i $INET_IF --dport 5555 --sport 1024:65535 -j ACCEPT

#iptables -A INPUT -p tcp -i $INET_IF --dport 3000 --sport 1024:65535 -j ACCEPT

iptables -A INPUT -p tcp -i $INET_IF --dport 22 --sport 1024:65535 -j ACCEPT

iptables -A INPUT -p tcp -i $INET_IF --dport 31337 --sport 1024:65535 -j ACCEPT
iptables -A INPUT -p tcp -i $INET_IF --dport 31336 --sport 1024:65535 -j ACCEPT

iptables -A INPUT -p tcp -i $INET_IF --dport 113 --sport 1024:65535 -j ACCEPT

iptables -A INPUT -p tcp -i $INET_IF --dport 8888 -j ACCEPT

#tillåt DHCP
iptables -A INPUT -p udp --sport 67 --dport 68 --source 10.64.0.7 -j ACCEPT
iptables -A INPUT -p udp --sport 67 --dport 68 --source 192.168.254.10 -j ACCEPT

iptables -A INPUT -i $INET_IF -m state --state ESTABLISHED,RELATED -j ACCEPT

#Port forwarda till FTPN port 54321
iptables -t nat -A PREROUTING -p tcp --dport 5555 -j DNAT --to 192.168.0.2:21
iptables -A FORWARD -p tcp --destination-port 21 -j ACCEPT

# IDENT
iptables -t nat -A PREROUTING -p tcp --dport 113 -j DNAT --to 192.168.0.2:113
iptables -A FORWARD -p tcp --destination-port 113 -j ACCEPT

# tillåt hemma att komma in på fw
#iptables -A INPUT -j ACCEPT -p all -s 192.168.0.0/24 -i $LAN_IF
iptables -A INPUT -i $LAN_IF -j ACCEPT

#iptables -A OUTPUT -j ACCEPT -p all -d 192.168.0.0/24 -o $LAN_IF
iptables -A OUTPUT -o $LAN_IF -j ACCEPT

# spärra stängda nät på internet-ifacet
iptables -A INPUT -i $INET_IF -s 192.168.0.0/24 -j DROP
iptables -A INPUT -i $INET_IF -s 127.0.0.0/8 -j DROP

# starta internetdelning
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE

#iptables -A FORWARD -t filter -i $LAN_IF -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $LAN_IF -j ACCEPT
iptables -A FORWARD -i eth2 -j ACCEPT

#iptables -A FORWARD -t filter -i $INET_IF -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $INET_IF -m state --state ESTABLISHED,RELATED -j ACCEPT

# Logga och spärra resten
iptables -A INPUT -j logdrop

Nån kunnig som kanske kan hjälpa ?