Answer the question
In order to leave comments, you need to log in
Where is the error in IPTABLES?
The server has two network cards, eth0 -> distributes the Internet, eth1 -> receives the Internet. I needed to block all external connections to the server and add exceptions.
Here's what I did:
# Policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
# Разрешаем loopback
iptables -A INPUT -i lo -j ACCEPT
# Разрешим работу второй сетевой карты eth0
iptables -A INPUT -i eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -j ACCEPT
iptables -A OUTPUT -p ALL -j ACCEPT
# Разрешаем все установленные соединения
iptables -A INPUT -m state --state ESTABLISHED -j ACCEPT
# Разрешаем SSH
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 1715 -j ACCEPT
Answer the question
In order to leave comments, you need to log in
# Policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -P INPUT DROP
iptables -P FORWARD DROP
1. The order of -P and -A does not matter. -P is what is applied if nothing else is applied.
2. Where are the routes?
3. Where is the nat?
UPDT
Replace -m state with -m conttrack and --state ESTABLISHED with --ctstate ESTABLISHED
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question