Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm working with wheezy.

I have configured the /etc/network/interfaces file so that the wlan gets the ip address from the dhcp server.

after that I have imposed a different static ip address in the interfaces file.

First problem: everytime I reboot the machine it gets always the old address, the one that the dhcp server gave to it. I tryed to remove the leases from /var/lib/dhcp/*leases but when it reboots the leases file reappears and in it the old lease as well.

second problem: if I force to change ip address using ifconfig on the interface it works but I have 2 different ip addresses on the same wlan, one is the new ip address and the other is the one given by the dhcp server.

any idea to solve these problems?

Last configuration:

 auto lo eth0
 iface lo inet loopback

 iface eth0 inet static
    address 192.168.1.150
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    #gateway 192.168.1.10

    post-up route add default gw 192.168.1.10 eth0
    pre-down route del default gw 192.168.1.10 eth0


  allow-hotplug wlan2
  auto wlan2
 iface wlan2 inet manual
    #wireless-essid "dlink"
    address 192.168.1.130
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    #gateway 192.168.1.20

    pre-up wpa_supplicant -B w -D wext -i wlan2 -c /etc/wpa_supplicant/wpa_$
    post-down killall -q wpa_supplicant

    post-up route add default gw 192.168.1.20 wlan2
    pre-down route del default gw 192.168.1.20 wlan2

    iface default inet dhcp

wpa_supplicant:

 ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
 update_config=1

network={
    ssid="dlink"
    proto=WPA RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP TKIP
    group=CCMP TKIP
    psk=wpapassword
}

here the ifconfig -a output:

eth0      Link encap:Ethernet  HWaddr c8:a0:30:b2:8c:89
      inet addr:192.168.1.150  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::caa0:30ff:feb2:8c89/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:3967 errors:0 dropped:2 overruns:0 frame:0
      TX packets:3202 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:442495 (432.1 KiB)  TX bytes:345005 (336.9 KiB)
      Interrupt:56

lo        Link encap:Local Loopback
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:2 errors:0 dropped:0 overruns:0 frame:0
      TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:190 (190.0 B)  TX bytes:190 (190.0 B)

wlan2     Link encap:Ethernet  HWaddr 80:1f:02:9b:bd:bf
      inet addr:192.168.1.77  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::821f:2ff:fe9b:bdbf/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:962 errors:0 dropped:0 overruns:0 frame:0
      TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:135034 (131.8 KiB)  TX bytes:3622 (3.5 KiB)
share|improve this question

migrated from stackoverflow.com Jun 25 '13 at 11:47

This question came from our site for professional and enthusiast programmers.

    
Are you sure that you are not configuring virtual devices, (ex eth0:1) ? –  Edorka Jun 24 '13 at 14:42
1  
yes I'm, I'll post my configuration –  Gappa Jun 24 '13 at 15:09
    
why auto wlan2 iface wlan2 inet manual i whould commet that line –  Edorka Jun 24 '13 at 15:14
    
auto indicates that the interface has to be loaded during startup, isn't it? anyway I tryed to comment that line but nothing changed –  Gappa Jun 24 '13 at 15:24
    
Maybe there is another dhcp client running –  Edorka Jun 24 '13 at 20:19

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.