Score:0

no http connection after iptables changes

sj flag

After i changed the settings in the iptables i have no http connection with lynx and no apt update works anymore but i cant see the flaw in my configuration. My iptable config:

Chain INPUT (policy ACCEPT)  
target     prot opt source               destination  
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:https  
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http  
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain  
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:domain  
f2b-sshd   tcp  --  anywhere             anywhere             multiport dports ssh  
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh  
DROP       all  --  anywhere             anywhere  

Chain FORWARD (policy ACCEPT)  
target     prot opt source               destination  

Chain OUTPUT (policy ACCEPT)  
target     prot opt source               destination  
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:https  
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http  
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain  
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:domain  
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh  
ACCEPT     all  --  anywhere             anywhere  

Chain f2b-sshd (1 references)  
target     prot opt source               destination  
RETURN     all  --  anywhere             anywhere

I cant see the problem here i have only one drop rule and the ssh connection is working.. can someone pls give a hint?

:INPUT ACCEPT [61922:10623683]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [1791:187049]
:f2b-sshd - [0:0]
-A INPUT -p tcp -m tcp --dport 20 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 21 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -j DROP
-A OUTPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A OUTPUT -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 53 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A OUTPUT -j ACCEPT
-A f2b-sshd -s 218.92.0.191/32 -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -j RETURN
COMMIT

diya avatar
la flag
Generally I prefer the output of `iptables-save` and failing that the output of `iptables -L -v -n` - but generally when you're blocking almost all ingress traffic (with the last rule on the INPUT chain) you also block the responses for connections you're making from a system. I think you should have a `sudo iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT` rule
MKDE avatar
sj flag
i insert the rule and it seems apt update gets a connection but is not able to fetch the pakets "not able to resolve" and lynx still doesnt work
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.