0

Hi everybody when modifiying /etc/network/interfaces, saving it and then executing ifconfig i can't see the modification i made..for example here is part of my

/etc/network/interfaces:

auto wlan1
iface wlan1 inet static
address 192.168.0.60
netmask 255.255.255.0
gateway 192.168.0.61

you can see that the IP address of my wlan1 is 192.168.0.60 but when typing ifconfig i have this:

wlan1     Link encap:Ethernet  HWaddr 00:19:70:0f:c2:9c  
          inet adr:192.168.0.1  Bcast:192.168.0.255  Masque:255.255.255.0
          adr inet6: fe80::219:70ff:fe0f:c29c/64 Scope:Lien
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Packets reçus:758 erreurs:0 :0 overruns:0 frame:0
          TX packets:610 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000 
          Octets reçus:73490 (73.4 KB) Octets transmis:127883 (127.8 KB)

(the inet adr:192.168.0.1 and not 198.168.0.60)..if someone can help me I'll be very thankful :)

Sirch
  • 5,785
  • 4
  • 20
  • 36
user2478348
  • 1
  • 1
  • 1

2 Answers2

3

You need to restart networking, or at the very least take the interface down and back up again.

Restart networking (DON'T do this if you're logged in via SSH!):

/etc/init.d/networking restart

Or to 'bounce' the interface (DON'T do this if you're logged in via SSH, via this interface!):

ifdown wlan1
ifup wlan1
fukawi2
  • 5,396
  • 3
  • 32
  • 51
0

Merely editing the init configuration for the interface isn't adequate to change it at runtime. The interface will be configured like you specified at the next boot.

To change it right away, you could restart the init script for the interface. Additionally, you could simply issue ifconfig wlan1 192.168.0.60 255.255.255.0. If the gateway has also changed you would need to change the route (something like ip route change default via 192.168.0.61 dev wlan0).

Falcon Momot
  • 25,244
  • 15
  • 63
  • 92