How can run a instruction when Ubuntu12.04 starting up??

Karl Auer kauer at biplane.com.au
Sun Sep 2 08:41:02 UTC 2012


On Sun, 2012-09-02 at 16:30 +0800, Levi Nie wrote:
> I want to run "sudo ifconfig eth0 192.168.64.3"  automaticly when my VM
> starting up.

Static configuration of network interfaces is generally achieved by
editing /etc/network/interfaces ("man interfaces). A likely stanza to do
what you want might be:

   auto eth0
   iface eth0 inet static
      address 192.168.64.3
      netmask 255.255.255.0
      gateway 192.168.64.1
      broadcast 192.168.64.255

Depending on circumstances you may be able to leave out the broadcast
and/or gateway lines.

For IPv6 it looks like this:

   auto eth0
   iface eth0 inet6 static
      address 2001:db8:0:100::3
      netmask 64

There is no broadcast address in IPv6, and the gateway will generally be
delivered via router advertisements.

Regards, K.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
http://www.biplane.com.au/blog

GPG fingerprint: AE1D 4868 6420 AD9A A698 5251 1699 7B78 4EEE 6017
Old fingerprint: DA41 51B1 1481 16E1 F7E2 B2E9 3007 14ED 5736 F687





More information about the ubuntu-users mailing list