Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to block access to the gateway (192.168.1.1) on port 80, to prevent network user from trying to access the router setup. I'm using Ubuntu 9.10

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted
iptables -A INPUT -j DROP -p tcp --to-destination 192.168.1.1:80 -i eth0

Change --to-destination 192.168.1.1:80 to the IP address of the gateway.

Change -i eth0 to the interface that you need the rule on.

Note that this will completely block all access to that IP/port combination unless you create a specific rule to allow traffic from one IP, like perhaps an administrative workstation.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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