dhcrelay問題?

dhcrelay問題?

dhcpd 回覆未到達最終客戶端。

背景: 房屋網絡:

107.nn.164.89 - 連接互聯網

192.168.100.0/24 - 內部 LAN1

192.168.1.254/30 - 曼卡夫的網關

曼卡夫:

192.168.1.253/30 - 通往房屋的網關

192.168.200.254/24 - 曼卡夫本地 LAN1

mancave dhcrelay 向在 house lan1 上執行的 dhcp 伺服器發送請求(該伺服器也在 1.254/30 上偵聽)

house dhcp 對這些請求做出回應。

我可以在 1.253 上看到來自房屋的回复,並且 dhcrelay 將其發送到 200.0/24 網路;至少我是這麼認為的。

200.0/24 網路顯示請求已發出,沒有任何回傳。

如果我手動設定 IP、網關等,我可以從 mancave 中的 200.0/24 網路衝浪(或其他)。

dhcrelay、route、tcpdump 如下:

darouter 是家庭網絡

[root@darouter named]# tcpdump -i ens2 -nn port 67 or port 68
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ens2, link-type EN10MB (Ethernet), capture size 262144 bytes
07:10:26.347170 IP 192.168.1.253.67 > 192.168.1.254.67: BOOTP/DHCP, Request from 00:e8:fb:00:67:37, length 548
07:10:26.347488 IP 192.168.1.254.67 > 192.168.200.254.67: BOOTP/DHCP, Reply, length 310
07:10:34.427024 IP 192.168.1.253.67 > 192.168.1.254.67: BOOTP/DHCP, Request from 00:e8:fb:00:67:37, length 548
07:10:34.427282 IP 192.168.1.254.67 > 192.168.200.254.67: BOOTP/DHCP, Reply, length 310

dacave 是 mancave 網路;第一個是 1.253/30 淨值

[root@dacave ~]# tcpdump -i enp3s0 -nn port 67 or port 68
dropped privs to tcpdump
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp3s0, link-type EN10MB (Ethernet), capture size 262144 bytes
09:09:45.827122 IP 192.168.1.253.67 > 192.168.1.254.67: BOOTP/DHCP, Request from 00:e8:fb:00:67:37, length 548
09:09:45.827647 IP 192.168.1.254.67 > 192.168.200.254.67: BOOTP/DHCP, Reply, length 310
09:09:53.906938 IP 192.168.1.253.67 > 192.168.1.254.67: BOOTP/DHCP, Request from 00:e8:fb:00:67:37, length 548
09:09:53.907477 IP 192.168.1.254.67 > 192.168.200.254.67: BOOTP/DHCP, Reply, length 310
^C
4 packets captured

200.0/24 網:

[root@dacave ~]# tcpdump -i enp5s0 -nn port 67 or port 68
dropped privs to tcpdump
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp5s0, link-type EN10MB (Ethernet), capture size 262144 bytes
09:09:45.827036 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:e8:fb:00:67:37, length 548
09:09:53.906885 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:e8:fb:00:67:37, length 548
^C
2 packets captured

dhcrelay 配置:

[root@dacave ~]# show dhc
206:  82462 ?        Ss     0:00 /usr/sbin/dhcrelay -d --no-pid 192.168.1.254 -i enp5s0

曼卡夫路線-n

[root@dacave ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.254   0.0.0.0         UG    100    0        0 enp3s0
192.168.1.252   0.0.0.0         255.255.255.252 U     100    0        0 enp3s0
192.168.200.0   0.0.0.0         255.255.255.0   U     101    0        0 enp5s0
[root@dacave ~]# 

房屋路線-n

[root@darouter named]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         107.nn.164.89  0.0.0.0         UG    100    0        0 enp2s0f0
0.0.0.0         192.168.1.253   0.0.0.0         UG    101    0        0 ens2
107.nn.164.88  0.0.0.0         255.255.255.252 U     100    0        0 enp2s0f0
192.168.1.252   0.0.0.0         255.255.255.252 U     100    0        0 ens2
192.168.100.0   0.0.0.0         255.255.255.0   U     100    0        0 enp2s0f1
192.168.200.0   192.168.1.254   255.255.255.0   UG    0      0        0 ens2
[root@darouter named]# 

正如您所看到的,200.0/24 網路上沒有回任何回應。

我是否缺少路線?

哦,防火牆是敞開的(輸入、輸出和轉發接受)。我已嘗試 'iptables -t nat -A POSTROUTING -o enp3s0 -j SNAT 至 192.168.1.253 並已將 SNAT 行全部刪除。

無法將 dhcrelay 放入“標籤”中 - 為什麼有人需要 300 名代表才能做到這一點?

icarus:在 dhcrelay 啟動中嘗試了 -m 轉發 - 沒有看到差異。追蹤返回頁面的東西。我不熟悉該指令,--help 對我沒有幫助。我可以 grep 某些內容或設定一些命令列開關來提供幫助嗎?我確實注意到在啟動過程中,dhcrelay 列印的最後一條訊息是「已刪除所有功能」。如果你知道,那又意味著什麼?

另外,將 -v 加到 tcpdump 行會產生:

dropped privs to tcpdump
tcpdump: listening on enp3s0, link-type EN10MB (Ethernet), capture size 262144 bytes
09:49:42.961047 IP (tos 0x0, ttl 64, id 4, offset 0, flags [DF], proto UDP (17), length 576)
    192.168.1.253.67 > 192.168.1.254.67: BOOTP/DHCP, Request from 00:e8:fb:00:67:37, length 548, hops 1, xid 0xdf341d5f, secs 3, Flags [none]
          Gateway-IP 192.168.200.254
          Client-Ethernet-Address 00:e8:fb:00:67:37
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Discover
            MSZ Option 57, length 2: 548
            Requested-IP Option 50, length 4: 192.168.200.101
            Lease-Time Option 51, length 4: 4294967295
            Parameter-Request Option 55, length 14: 
              Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
              Domain-Name, RP, TTL, BR
              MD, Router-Discovery, Static-Route, YD
              YS, NTP
            Vendor-Class Option 60, length 23: "Linux 2.4.20-uc0 armv3l"
            Client-ID Option 61, length 7: ether 00:e8:fb:00:67:37
09:49:42.961603 IP (tos 0x0, ttl 64, id 37859, offset 0, flags [DF], proto UDP (17), length 338)
    192.168.1.254.67 > 192.168.200.254.67: BOOTP/DHCP, Reply, length 310, hops 1, xid 0xdf341d5f, secs 3, Flags [none]
          Your-IP 192.168.200.10
          Gateway-IP 192.168.200.254
          Client-Ethernet-Address 00:e8:fb:00:67:37
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Offer
            Server-ID Option 54, length 4: 192.168.1.254
            Lease-Time Option 51, length 4: 86400
            Subnet-Mask Option 1, length 4: 255.255.255.0
            Default-Gateway Option 3, length 4: 192.168.200.254
            Domain-Name-Server Option 6, length 4: 192.168.1.254
            Hostname Option 12, length 6: "UpEast"
            Domain-Name Option 15, length 14: "todhackett.com"
            BR Option 28, length 4: 255.255.255.255
            NTP Option 42, length 4: 192.168.1.254
^C
2 packets captured

如果有幫助的話。

成功了。 dhcrelay 手冊指出,您將連接埠設定為偵聽 dhcp 請求,而我則將 1.252/30 排除在外,因為那裡只有 2 個 IP。好的,所以我有時會短路的大腦認為確實有 dhcp 回覆訊息進來,所以我也將 1.252/30 介面設定為在線

dhcrelay -d --no-pid -i enp5s0 -i enp3s0 192.168.1.254

一切都很棒!感謝您的回覆!

相關內容