Obtainning the public IP with EtherCard Library and ...

I built a simple arduino server,using the EtherCard library.. Can I obtain my public ip address ?.. and can I make my arduino server listen only to a selected port?

Try http://www.whatsmyip.org from a web browser.

I don't know about making the Arduino only listen for a particular port, but your router should be configurable to only forward a particular port to the Arduino's IP address.

type 'what is my ip address' into google.

may configuring my router would help.thanx for the idea.

But I need to obtain my Public ip by arduino itself...cant EtherCard library do that?

I imagine that you could make it read http://www.whatsmyip.org, and parse the result. Why does the Arduino need to know your public address?

thats a good idea, is it possible to do so?

Im building this server so I can access thos via internt also, not just a lan server. But I have a DSL connection Dynamic IP . so I have to update my website with my server IP frequently. There are other ways such as DDNS and pachube.. But as this is a Uni project I need to do something by myself. so I had this little idea of obtaining my public ip qith arduino n update my web page with that some how.

if you can write php, have the arduino occasionally call a website page ( RefreshArduinoIP.php ), then use the php server variables to get the ip address of the client, then save that in a text file your other pages can read to talk to the arduino.

EDIT: I believe the $_SERVER[ 'REMOTE_ADDR' ] variable will contain the public IP of the client.