我的Raspberry Pi B +正在运行Raspbian(Linux版本3.18.11+)更新等。
它通过以太网连接到网络。我想要一个静态IP,并在/ etc / network / interfaces中为其分配了一个IP(如下所示)。但是,每次引导它都会通过DHCP请求一个地址,并分配一个地址!静态和动态地址都可以访问网络上的计算机。
在哪里可以阻止DHCP地址的请求和分配?
/ etc / network / interfaces
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.7
netmask 255.255.255.0
gateway 192.168.1.1
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
auto wlan1
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
ip addr show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether b8:27:eb:44:bb:23 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.7/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet 192.168.1.55/24 brd 192.168.1.255 scope global secondary eth0
valid_lft forever preferred_lft forever
ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:44:bb:23
inet addr:192.168.1.7 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11484 errors:0 dropped:4 overruns:0 frame:0
TX packets:10212 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4178807 (3.9 MiB) TX bytes:4019638 (3.8 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1