I have to config a new vsphere 4.x, but I dont want to config by hand all networking configuration. is There any way to generate a script that could be modified a run in the new host.
Yes, theres a powercli script that should help you with this. Take a look at http://www.virtu-al.net/2009/06/27/powercli-easy-vswitch-portgroup-setup/
Here is the script to do network configurationf from ESXi commandline.