Blocking ports on the public IP assigned to lo interface in GNU/Linux
Posted
by
nixnotwin
on Server Fault
See other posts from Server Fault
or by nixnotwin
Published on 2012-07-03T17:07:15Z
Indexed on
2012/07/03
21:17 UTC
Read the original article
Hit count: 317
I have setup my Ubuntu server as a router and webserver by following the answer given here. My ISP facing interface eth0
has a private 172.16.x.x/30 ip and my lo
interface has a public IP as mentioned in the answer to the question linked above. The setup is working well. The only snag I have experienced is that I could not find a way to block the ports exposed by the public IP on the lo
interface. I tried doing iptables -A INPUT -i eth0 -j DROP
, and my server lost connectivity to the public network (internet). I could not ping any public ips. What I want is a way to block ports that are exposed by the public ip on the lo
interface. And also I require iptables rules that can expose ports like 80
or openvpn port to the public network.
© Server Fault or respective owner