我的树莓派暂时有一个静态IP。现在配置看起来像这样。
/etc/网络/接口
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
但这会导致保留可用 dhcp ip 的完整范围。
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:94:90:82 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.29/24 brd 192.168.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet 192.168.2.30/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.31/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.32/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.33/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.34/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.35/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.36/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.37/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.38/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.39/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.41/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.42/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.43/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.44/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.45/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.40/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.46/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.47/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.49/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.50/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.51/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.52/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.53/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.54/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.55/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.56/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.57/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.58/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.59/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.60/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.61/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.62/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.63/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.64/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.65/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.66/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.67/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.68/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.69/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.70/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.71/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.72/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.73/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.74/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.75/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.77/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.78/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.79/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.80/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.81/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.82/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.83/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.84/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.85/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.86/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.87/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.88/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.89/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.90/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.91/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.92/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.93/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.94/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.95/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.96/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.97/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.98/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.99/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.100/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.101/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.102/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.103/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.104/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.105/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.106/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.107/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.108/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.109/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.110/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.111/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.112/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.113/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.114/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.115/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.116/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.117/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.118/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.119/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.120/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.121/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.122/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.123/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.124/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.125/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.126/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.127/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.128/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.129/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.130/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.131/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.132/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.133/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.134/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.135/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.136/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.137/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.138/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.139/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.141/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.142/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.143/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.144/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.145/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.146/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.147/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.148/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.149/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.150/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.151/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.152/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.153/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.154/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.155/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.156/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.157/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.158/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.159/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.161/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.162/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.163/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.164/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.165/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.166/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.167/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.168/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.169/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.170/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.171/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.172/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.173/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.174/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.175/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.176/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.177/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.178/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.179/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.180/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.181/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.182/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.183/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.184/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.185/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.186/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.187/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.188/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.189/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.190/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.191/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.192/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.193/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.194/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.195/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.196/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.197/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.198/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.200/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.199/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.24/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.26/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.27/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 192.168.2.28/24 brd 192.168.2.255 scope global secondary eth0
valid_lft forever preferred_lft forever
问题是什么?
(树莓派 GNU/Linux 8)
答案1
回答
没有问题。
解释
该输出仅表明从 192.168.2.24 到 192.168.2.200 范围内的任何 IP 地址均可出租。请注意,该范围中缺少 192.168.2.25 和 192.168.2.199。这意味着您的 raspbian 和另一台设备已经获得了这两个地址。
您的假设是正确的,整个池被保留,因为所有地址都可供使用。可以这样想:
我们去你最喜欢的餐厅,告诉女主人我们想要一张 2 人的桌子。假设餐厅是空的,如果我们说我们甚至想要 2 张桌子,女主人会给我们 2 个预订的桌子,但实际上整个餐厅都是空的。为我们和其他付费客户“保留”。这会导致“所有桌子”的预订。女主人知道整个范围都是可用的,就像 DHCP 知道可用地址的范围一样。