1

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 

1 Answer 1

3

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

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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