This can be done by using autofs.
edit the file /etc/auto_master
## Automounter master map
#
+auto_master # Use directory service
/net -hosts -nobrowse,hidefromfinder,nosuid
/home auto_home -nobrowse,hidefromfinder
/Network/Servers -fstab
/Users/broersa/Documents/Shares auto_resources
/- -static
The line starting with /Users is added. This will automount on the path selected. It will pick the resources from auto_resources. This is a new file we have to create:
all -fstype=smbfs ://username:password@192.168.2.254/all
This will automount the share all on the path /Users/broersa/Documents/Shares/all
do a "chmod 600 auto_resources" to protect the username password from other users then root.
reload the config.
automount -vc
Don't forget to do everything as sudo.
Now you have your share always available when in range.