You can do it with the help of server to server in openfire. Please go through this document http://www.igniterealtime.org/community/docs/DOC-1030 for detail. It may be helpful to you.
You should open 5222 port and point it to Openfire server in a router connecting your LAN with outside WAN. Also, if you want to use servername to login, there should be corresponding DNS entries in your DNS service.
Does your server have a public or private IP address? If it is private, you need to do NAT on your router, so that your public IP will point to your private IP and port assignment…
Otherwise, you need to create a DMZ and give your server a public IP address if one is available to you. If you have a standard Cable or DSL account, then you probably do not have an extra public IP address and would have to buy one.
NAT (Network Address Translation) or sometime called reverse NAT in this scenerio, is really the way you should probalby go…
Check your router and see if it will let you create NATs. It will go something like this:
public IP address:80 = private IP address:80
or whatever ports you need. The above example would work if you were running a web server on port 80.