0

I have below firewall configuration which is DROP/DENY by default but I am unable to browse any webpage what am I missing ? Note:- I have ens33 as interface and Ubuntu is the OS I m using.

root@ubuntu:~# iptables -L -n -v --line-number
Chain INPUT (policy DROP 360 packets, 33205 bytes)
num   pkts bytes target     prot opt in     out     source               destination         
1      720 54133 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
2        0     0 ACCEPT     tcp  --  ens33  *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80 state NEW,ESTABLISHED
3        0     0 ACCEPT     tcp  --  ens33  *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80 state NEW,ESTABLISHED
4        0     0 ACCEPT     tcp  --  ens33  *       0.0.0.0/0            0.0.0.0/0            tcp dpt:443 state NEW,ESTABLISHED
5       28  4698 ACCEPT     udp  --  ens33  *       0.0.0.0/0            0.0.0.0/0            udp spt:53
6        5   420 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 0

Chain FORWARD (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy DROP 4166 packets, 357K bytes)
num   pkts bytes target     prot opt in     out     source               destination         
1       28  1744 ACCEPT     udp  --  *      ens33   0.0.0.0/0            0.0.0.0/0            udp dpt:53
2        5   420 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8
3        0     0 ACCEPT     tcp  --  *      ens33   0.0.0.0/0            0.0.0.0/0            tcp spt:80 state NEW,ESTABLISHED
4        0     0 ACCEPT     tcp  --  *      ens33   0.0.0.0/0            0.0.0.0/0            tcp spt:443 state NEW,ESTABLISHED
root@ubuntu:~# 
1

Replace destination to source port or source port to destination port for 80 and 443 ports in INPUT and OUTPUT iptables chains.

  • Thanks @Mikhail though my problem is solved but strange thing is eventhough I do a iptables --flush still rules seems to be applied on browsing though iptables -L shows no rules that were there ....any idea? – pkm Jul 18 '17 at 6:08
  • It's depend of Linux OS version. Usually iptables is saved by command service iptables stop and when OS is going to shutdown. If you want to edit saved rules file, iptables service must be stopped. – Mikhail Khirgiy Jul 19 '17 at 5:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.