mavihemi, welcome to the forums!
What OS are you using on the remote machine? If Linux, you need to double check the /etc/hosts file, most likely it is misconfigured. Even in Windows, an improperly set hosts file can cause similar strange behavior.
BTW, I just now tried out your scenario and had no problem successfully logging into admin console remotely and deploying an app.
I'm using Windows XP OS in both machines and the IP address to access the machines.
The hosts files has the same contents "127.0.0.1 localhost", is it ok or should be different?
I think you are running into this bug https://jira.jboss.org/browse/EMBJOPR-218. JBoss AS 5.1.0 ships with 1.2.0 of Embedded Jopr (which has this bug).
I remember there was a similar thread in one of the forums here, but I'm not able to find that one right now due to the horrible and slow search in these forums.
I'll try to install an upper version.