linux.network.dnsmasq dhcp

2018-11-30  本文已影响0人  余带盐

dnsmasq --no-hosts --no-resolv --strict-order --except-interface=lo --pid-file=/root/dnsmasq/dhcp/pid --dhcp-hostsfile=/root/dnsmasq/dhcp/host --dhcp-match=set:ipxe,175 --bind-interfaces --interface=dhcp_tap --dhcp-range=10.0.0.2,10.0.0.254 --dhcp-option-force=option:mtu,1450 --dhcp-lease-max=512 --dhcp-option=3,10.0.0.1 --dhcp-option=6,8.8.8.8

dnsmasq
--no-hosts  #不加载本地的 /etc/hosts 文件
--no-resolv #不读取/etc/resolv.conf.,获取dns只从命令行或者dnsmasq配置文件读取
--strict-order #严格按照resolv.conf中的顺序进行查找
--except-interface=lo #不监听lo网卡
--pid-file=/root/dnsmasq/dhcp/pid  #保存dnsmasq进程pid号的文件
--dhcp-hostsfile=/root/dnsmasq/dhcp/host  #读取该文件保存的dhcp的mac、ip信息
--dhcp-match=set:ipxe,175  #设置dhcp tag
--bind-interfaces  #绑定接口,开启此项将仅监听指定的接口
--interface=dhcp1_tap1  #要监听的端口
--dhcp-range=10.0.0.2,10.0.0.254  #地址池
--dhcp-option-force=option:mtu,1450  #指定mtu=1450
--dhcp-lease-max=512  #dnsmasq为dhcp提供租约的最大个数,默认1000
--dhcp-option=3,10.0.0.1  #3为default route,指定默认路由网关
--dhcp-option=6,8.8.8.8  #指定dns
  1. --dhcp-hostsfile=/root/dnsmasq/dhcp/host
    这个配置可由多个--dhcp-host=mac,ip替代
上一篇 下一篇

猜你喜欢

热点阅读