1) 需要配置/etc/cobbler/module.conf, 把manage_dns和manage_dhcp改為manage_dnsmasq
2) 重啟cobbler和dnsmasq服務,dnsmasq總是不成功,原因是之前提供dns服務和dhcp服務的named和dhcpd進程還在占用着相應的端口
如果查看systemctl status dnsmasq,有如下的錯誤:
dnsmasq: failed to create listening socket: Address already in use
經過sudo netstat -nlp | grep 53 #(注意必須價sudo,否則看不到進程的名字,也就是這個錯誤:No info could be read for "-p": geteuid()=1000 but you should be root.)
得到
tcp 0 0 10.108.125.112:53 0.0.0.0:* LISTEN 53348/named
於是通過ps查到named進程kill掉。
再重啟dnsmasq時又遇到如下錯誤:
dnsmasq: failed to bind DHCP server socket: Address already in use
同理,這是dhcpd進程占用了端口,kill掉,再重啟dnsmasq一般就可以了。
(ps,如果不能成功pxe boot鏡像,那就用sudo cobbler check檢查以下問題,然后解決一下就可以了,一般是需要enable並start rsyncd服務)
貢獻dnsmasq.template文件:(我用本機做了dhcp服務的代理。)
# Cobbler generated configuration file for dnsmasq # $date # # resolve.conf .. ? # enable-tftp tftp-root=/var/lib/tftpboot tftp-no-blocksize log-dhcp log-facility=/var/log/dnsmasq #no-poll #enable-dbus read-ethers addn-hosts = /var/lib/cobbler/cobbler_hosts #dhcp-range=192.168.1.5,192.168.1.200 #dhcp-range=10.108.124.100,10.108.124.250,255.255.252.0 dhcp-range=10.108.125.112,proxy #dhcp-ignore=tag:!known #dhcp-option=3,$next_server #dhcp-lease-max=1000 #dhcp-authoritative dhcp-option=vendor:PXEClient,6,2b pxe-service=X86PC, "Boot from network", pxelinux dhcp-boot=pxelinux.0 dhcp-boot=net:normalarch,pxelinux.0 dhcp-boot=net:ia64,$elilo $insert_cobbler_system_definitions