1

UPDATE 1:

I am using Apache 2 as the webserver. Can I block access to all IP addresses except 3 from Apache?

ORIGINAL QUESTION:

I have a Linksys BEFSR41 router and have opened port 80 for development purposes. Is it possible to block access to port 80 to everyone except certain IP addresses? So port 80 should only be accessable to about 3 ip addresses from outside the internal network.

I have tried looking at the manaul for the BEFSR41, but can't seem to find what I am looking for. Or maybe, I don't understand what this type of filtering is called.

oshirowanen
  • 292
  • 4
  • 13

4 Answers4

1

If your router can't handle it, you could take advantage of Apache's 'Allow from' directive, either globally or at a site-specific level. Or, if you're running Apache on Linux, open up port 80 on IPTables with something like:

-A INPUT -i eth0 -p tcp -m tcp -s [your.first.ip] --dport 80 -j ACCEPT

-A INPUT -i eth0 -p udp -m udp -s [your.first.ip] --dport 80 -j ACCEPT

-A INPUT -i eth0 -p tcp -m tcp -s [your.second.ip] --dport 80 -j ACCEPT

-A INPUT -i eth0 -p udp -m udp -s [your.second.ip] --dport 80 -j ACCEPT

etc.

jetboy
  • 912
  • 2
  • 11
  • 25
0

From everything I can tell about that router it does not offer source port routing. One option if you have an old PC and a pair of network cards would be a setup of IPCOP. Free firewall with lots of great features.

Andrew Rice
  • 154
  • 4
0

No. The BEFSR41 is a consumer grade router, and will not have the functionality you are looking for out of the box.

It may be able to install DD-WRT or tomato on it to get more functionality.

DanBig
  • 11,423
  • 1
  • 29
  • 53
0

Have you looked at your web server to see if it has that granularity? Most "decent" web servers will support that exact functionality.

user48838
  • 7,431
  • 2
  • 18
  • 14