На следующей неделе я организую LAN-вечеринку, на которой мы создадим изолированную LAN без подключения к интернету. Поскольку я не хочу устанавливать статические IP-адреса на некоторых 8 компьютерах, я подумал о настройке DHCP-сервера на моем компьютере. Я обнаружил, что есть dhcp3-server
.
Проблема, вероятно, заключается в том, что сервер DHCP будет работать все время, вызывая проблемы, когда я нахожусь в другой сети. Как я могу настроить его так, чтобы я просто запускал его на вечеринке в локальной сети?
Я использую Kubuntu с KDE, если это имеет какое-то значение.
Хорошо, у меня установлен сервер dhcp, но он не запускается. Я приложил вывод некоторых команд, файлов конфигурации
ddns-update-style none;
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.100 192.168.100.200;
}
INTERFACES="eth0"
[ 1110] ifconfig eth0 Link encap:Ethernet HWaddr f0:de:f1:de:a2:90
UP BROADCAST MULTICAST MTU:1500 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:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:20 Memory:f2500000-f2520000
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:16436 Metric:1
RX packets:2830 errors:0 dropped:0 overruns:0 frame:0
TX packets:2830 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:405626 (405.6 KB) TX bytes:405626 (405.6 KB)
wlan0 Link encap:Ethernet HWaddr 10:0b:a9:bf:e8:fc
inet addr:131.220.201.217 Bcast:131.220.207.255 Mask:255.255.248.0
inet6 addr: fe80::120b:a9ff:febf:e8fc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:43878 errors:0 dropped:0 overruns:0 frame:0
TX packets:27630 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:52123963 (52.1 MB) TX bytes:2967812 (2.9 MB)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 131.220.207.254 0.0.0.0 UG 0 0 0 wlan0
131.220.200.0 0.0.0.0 255.255.248.0 U 2 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0
isc-dhcp-server stop/waiting
Internet Systems Consortium DHCP Server 4.1-ESV-R4
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Wrote 0 leases to leases file.
No subnet declaration for wlan0 (131.220.201.217).
** Ignoring requests on wlan0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface wlan0 is attached. **
Not configured to listen on any interfaces!
Internet Systems Consortium DHCP Server 4.1-ESV-R4
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Wrote 0 leases to leases file.
No subnet declaration for eth0 (no IPv4 addresses).
** Ignoring requests on eth0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface eth0 is attached. **
Not configured to listen on any interfaces!
Есть много вариантов, но самый простой способ - установить его непосредственно перед вечеринкой, а затем удалить его перед подключением к другой сети.
dhcp3-сервер устанавливает вариант ISC DHCP-сервера.
Остановите сервер после загрузки или когда он вам не нужен:
sudo service isc-dhcp-server stop sudo service isc-dhcp-server6 stop
Когда вы будете готовы к вечеринке, начните с:
sudo service isc-dhcp-server start sudo service isc-dhcp-server6 start