Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm creating an application with client-server architecture in java. What I'm trying to achieve is a simple client-server architecture connected via LAN with an ethernet switch, the server is having a server module of application running and also having MySQL database, the clients do their processing and submit results on server database, database also used for authentication.

The Server would be the only machine in network that will be connected to WAN through any ISP, the IP address of server machine cannot be guaranteed to be static, in this condition how the clients may connect to the server database? As the IP address of server is fluid..

One more doubt is that I've got to authenticate the clients also on the basis of their IP addresses (or it may also be physical MAC address, if simple to implement), I've got a table in the database that the server admin can update and stores the IP addresses of valid clients, now on connecting via LAN what will be the IP addresses allocated to the machines to be stored in database and will they be static? I've googled for this but did not found relevant answers...

share|improve this question

First of all, you didn't tell is it Linux, Windows,... server ?

Static IP can be replaced with dynDNS service but you will need to forward port 3306 (default MySQL port) from your router to MySQL server IP address and your servers IP address inside your LAN should be always the same (for example and outside from the DHCP pool so the router can't assign the same IP to other computers.

MAC based auth is nothing because MAC address can be changed and you won't be able to see the mac address from the clients outside your network. username/password auth paired with IP address restrictions on mysql server is enough.

share|improve this answer
` you didn't tell is it Linux, Windows,... server` since it is a java application, it is cross-plaform, and can be used uder both Linux and Windows...second thing is clients are connected to just LAN not internet,so will they do not have static IPs? – Asif Jan 9 '12 at 14:01
The server should have static IP or you will need some kind of internal DNS server so you can resolve the server IP address according to server's name. Or you can add IP-MAC pair into your DHCP server so the server will always give the same IP address to your server. The second part about MAC addresses is the same. Forget about MAC addresses because they can be changed easily and you won't have any kind of protection. If other computers also have dynamic IPs you can create usernames/passwords for them but do not lock IP address to accounts. (use % as a host) – mangia Jan 9 '12 at 21:58

Your Answer


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.