i want to set ip address to a virtual machine

hi all
i want to set ip address to a vitrual machine i am using following command.
but it is not ifconfig -a command output.
what is wrong i dont know

bash# ifconfig interfacename plumb
bash# ifconfig interfacename auto-dhcp

Hello,
Try this

ifconfig <interface> plumb x.x.x.x/x up

Now this is not a permanent fix. The server will revert back to the old IP address after a reboot. To prevent this perform the steps below.

echo x.x.x.x/x >  /etc/hostname.<interface>

Add the Ip address and hostname to the /etc/hosts file.

You may need to restart the networking service. Use this command to restart the service instead of restarting the server.

svcadm restart network/physical

I hope this helps.

first we need chk interface name by using #dladm show dev

Good Idea coolboys.
But you have a typo.

dladm show-dev

thanks for your replay
it works.