# Restore network in VM after recovering from suspension



## agnel_kurian (Apr 7, 2011)

I use FreeBSD in a VMware Virtual Machine. Between uses, I suspend the VM. However, on resuming, I find that Internet connectivity is lost.

To restore Internet access, I run *sysinstall* and select Configure > Networking > Interfaces > em0 and then select Yes for DHCP configuration. Once I select OK in the resulting dialog, Internet access is restored.

I would like to do the same thing from the command line without launching *sysinstall*. I am suspecting this has to do with *ifconfig* but all attempts so far have failed. (I have tried all options listed here: http://www.cyberciti.biz/tips/freebsd-how-to-start-restart-stop-network-service.html)

Can someone tell me what applet/program is launched by sysinstall for DHCP configuration?


----------



## wblock@ (Apr 7, 2011)

dhclient(8), but a down/up in ifconfig(8) might be enough.


----------



## agnel_kurian (Apr 9, 2011)

@wblock Thank you. *dhclient em0* worked for me.

Related question: How do I find the name of the interface (em0 in this case)? How are interface names assigned?


----------



## wblock@ (Apr 9, 2011)

ifconfig(8) by itself or with -a will list all the interfaces.  -l is the short form.

Interface names are assigned by whatever driver connects to the hardware.

Also see
`% man rc.conf | less -p ifconfig_DEFAULT`


----------

