Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I config static ip in /etc/network/interfaces

$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.121
netmask 255.255.255.0
gateway 192.168.1.1

and restart eth0 interface

$ sudo ifconfig eth0 down
$ sudo ifconfig eth0 up

but the eth0 interface doesn't change.

$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 90:e6:ba:22:6a:f2  
          inet addr:192.168.1.104  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::92e6:baff:fe22:6af2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7908 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10112 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5452712 (5.4 MB)  TX bytes:1534077 (1.5 MB)
          Interrupt:46 Base address:0x4000 
share|improve this question
add comment

1 Answer

Try the command: sudo /etc/init.d/networking restart

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.