Securing arduino as server

Hi all,

I'm new to arduino and I've been having lots of fun learning it. The only question I have so far is if there's anyway of securing ardunio as a server or putting a firewall on it. Specifically, I wanted to only allow certain range of address (vlan) to access my arduino. I've been googling for couple of days now and never found anything about this subject.

So far the only solution that I could think of is not to use it as a server. Instead, create a LAMP server and just pull data from arduino. Just looking for you guys' input before I go ahead on this direction. Thanks in advance!!

I'm not sure I follow.

If you use w5100 wiznet it can handle 4 max sockets, you're better off using php/appache, if it's only every now and then you coulx use an ethernet and arduino...

Can you expand your question?

When they connect, get their ip compare it against a whitelist let them in or kill the socket

well, on a LAMP server you could put a firewall and only allow certain range of IP addresses to access it's webpages. So i was wondering if you could do the same thing on arduino.

Your suggestion of comparing their IP address makes sense.

But as I try different sample codes for web server, it's beginning to become clear that I should just create my on server and pull data from arduino. I was testing codes from here: and some of it took a lot of memory (up to 25,000 bytes) from arduino.

pyro_65 came up with a solution. The code on this link allows you to access the client ip so you can use it to compare to your access list for your "firewall".

I wanted this to be included in the ethernet library, but some say it borks the API. I think that is a bunch of bull. I modify my ethernet library to include this function, and it doesn't bork mine.

edit: Here is my post with the ethernet library modifications attached.

oh wow, this is really helpful. I'll try this out. Thanks much.