weifan
V2EX  ›  问与答

局域网的任意一台 Linux 是不是都可以充当 DHCP 服务器?

  •  
  •   weifan · Dec 24, 2020 · 1303 views
    This topic created in 1993 days ago, the information mentioned may be changed or developed.

    局域网的任意一台 Linux 是不是都可以充当 DHCP 服务器?

    比如这样 网关:192.168.1.1, Linux1:192.168.1.11 , Linux2:192.168.1.12 , Linux3:192.168.1.13

    现在想用 Linux 1DHCP 服务器,IP 地址咋分配呀?

    目的是 Linux2 使用 Linux1 的 DHCP 分配 IP 地址

    4 replies    2020-12-25 11:08:31 +08:00
    Goldilocks
        1
    Goldilocks  
       Dec 24, 2020 via Android
    是。
    lcdtyph
        2
    lcdtyph  
       Dec 24, 2020   ❤️ 1
    Linux1 配置静态 IP
    网关 的 dhcp server 关掉
    Linux1 配置好 dhcp server,比如 dnsmasq 或者 isc-dhcp-server
    Tumblr
        3
    Tumblr  
       Dec 24, 2020   ❤️ 1
    是的,如 @lcdtyph #2 所说设置即可。
    不过多说一句就是,由于 DHCP 发现是通过广播,广播不能跨网段,所以只能在同一个子网( 192.168.1.0/24 )里,如果跨了,就要用到 DHCP 中继了。
    julyclyde
        4
    julyclyde  
       Dec 25, 2020
    @Tumblr
    广播不能跨越的是广播域
    二层没有网段这概念
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3184 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 00:23 · PVG 08:23 · LAX 17:23 · JFK 20:23
    ♥ Do have faith in what you're doing.