maxxle
21.01.03, 21:19
Ich hab mich jetzt auch mal hingesetzt und fang an an einer kleinen Firewall zu basteln.
Leider hab ich schon jetzt verständnisprobleme. Warum ist es denn nicht möglich mit den unteren Regeln auf Localhost zu pingen?
--------------------------------------------------------------------------------------------
# FLUSHING ALL EXISTING RULES
iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD
## CLOSING INPUT, OUTPUT, FORWARDING-CHAIN
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
## ACCEPT EVERYTHING IN MY OWN NETWORK
iptables -A INPUT -i eth0 -s 192.168.100.0/24 -j ACCEPT
iptables -A FORWARD -i eth0 -s 192.168.100.0/24 -j ACCEPT
iptables -A OUTPUT -o eth0 -d 192.168.100.0/24 -j ACCEPT
## NAT ##
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
--------------------------------------------------------------------------------------------
Mich würde zudem noch intressieren, warum man bei einem 'iptables -L' nur INPUT, OUTPUT, FORWARD und nicht eine 'nat'-Table sieht?
cya
maxxle
Leider hab ich schon jetzt verständnisprobleme. Warum ist es denn nicht möglich mit den unteren Regeln auf Localhost zu pingen?
--------------------------------------------------------------------------------------------
# FLUSHING ALL EXISTING RULES
iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD
## CLOSING INPUT, OUTPUT, FORWARDING-CHAIN
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
## ACCEPT EVERYTHING IN MY OWN NETWORK
iptables -A INPUT -i eth0 -s 192.168.100.0/24 -j ACCEPT
iptables -A FORWARD -i eth0 -s 192.168.100.0/24 -j ACCEPT
iptables -A OUTPUT -o eth0 -d 192.168.100.0/24 -j ACCEPT
## NAT ##
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
--------------------------------------------------------------------------------------------
Mich würde zudem noch intressieren, warum man bei einem 'iptables -L' nur INPUT, OUTPUT, FORWARD und nicht eine 'nat'-Table sieht?
cya
maxxle