eth0が起動すると、Wireguardは機能しません。

eth0が起動すると、Wireguardは機能しません。

設定

  • ルーターは私のネットワークでWireguardサーバーとして機能します。
  • ラズベリーパイ
    • オペレーティングシステム: Raspbian Buster
    • Wi-Fi経由でモバイルホットスポットに接続する(インターフェースwlan0)
    • et0は固定IPに設定されており、スイッチやルーターなしで固定IPデバイスを直接制御できます。
    • wg0は私のルーターのサーバーに接続するように設定されました。

質問

wireguard接続は、eth0を無効にした場合にのみ機能しますifconfig eth0 down

私がしたいこと:

Piでソフトウェアアップデートをアップデートしてテストする必要があります。ソフトウェアはeth0に接続されているデバイスを使用するため、eth0を有効にする必要があります。

私が試したこと

Google以外には何もありませんが、私の特定の問題に合ったものが見つかりません。

ルーティングテーブルを変更する必要があるようですが、Wi-Fi接続を妨げたくない人と私はわかりません。

PiのWireguardの設定

[Interface]
PrivateKey = myPrivateKey
Address = 192.168.180.201/24
DNS = 192.168.180.1
DNS = fritz.box

[Peer]
PublicKey = myPublicKey
PresharedKey = Key
AllowedIPs = 192.168.180.0/24,0.0.0.0/0
Endpoint = myfritzdomain:59047
PersistentKeepalive = 25

/etch/dhcpcd.confのeth0の設定

# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu

# Most distributions have NTP support.
#option ntp_servers

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
# OR generate Stable Private IPv6 Addresses based from the DUID
slaac private

interface eth0
static ip_address=192.168.1.45/16
static routers=192.168.1.1
static domain_name_servers=192.168.1.1

ベストアンサー1

私にとっての解決策は、static routers固定IPを定義する行を削除することでした。どちらも削除する必要があるかどうかわかりません。 Piがおそらく利用できない静的DNSを介して私のWireguradドメインを見つけようとしているので、DNSを削除するだけで十分だと思います。static domain_name_servers/etch/dhcpcd.conf

正しい方向にヒントをくれたABに感謝します。

おすすめ記事