
PC に Debian をインストールしようとしましたが、デフォルト ルートが取得できず、インターネットにアクセスできません。次のように表示されます。
ネットワークの自動構成は成功しました。ただし、デフォルト ルートは設定されていません。システムはインターネット上のホストと通信する方法を知りません。
ip route show
192.168.147.0/24 dev esp4n0 src 192.168.147.50
他のシステムはサブネット内で問題なく動作しているので、何が問題なのかはわかりません。すべてのシステムにはデフォルト ルートがあります。自分でデフォルト ルートを設定しようとしましたが、これも機能しませんでした。
ip route add default via 192.168.147.1
ip route show
default via 192.168.147.1 dev enp4s0 src 192.168.147.50
192.168.147.0/24 dev enp4s0 src 192.168.147.50
私はインターネット接続用のサーバー(dhcp、dnsなど)としてFritz.Box(192.168.178.1)を持っています。Fritz.Boxは私のサーバーシステムに静的IPを送信します。eth1(192.168.178.20)。私はサブネットをeth0isc-dhcp-server (192.168.147.0/24) 経由。Fritz.Box は頻繁に切断されますが、この方法だとネットワークが失われる心配がなくなります。
私のサーバーの構成は次のとおりです...
dhcpd.conf は、
#
# Sample configuration file for ISC dhcpd for Debian
# /etc/dhcp/dhcpd.conf
#
option domain-name "heimat.lokal";
option domain-name-servers 192.168.178.1;
option routers 192.168.147.1, 192.168.178.1;
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;
# DHCP-Server sollten das folgende Statement im globalen Bereich ihrer Konfiguration aufweisen, wenn der Administrator keine falsch konfigurierten "Rogue"-DHCP-Server im eigenen Netzwerk dulden will (also eigentlich immer):
authoritative;
default-lease-time 600;
max-lease-time 7200;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
subnet 192.168.147.0 netmask 255.255.255.0 {
#interface eth0;
range 192.168.147.50 192.168.147.60;
#option routers 192.168.178.1, 192.168.147.1;
}
/etc/default/isc-dhcp-server
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth0"
/etc/network/interfaces.d/gigabyte_mb_dual_gigabit_lan
auto eth0=lan0
auto eth1=lan1
# 01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)
iface eth0 inet manual
pre-up ifconfig $IFACE up
post-down ifconfig $IFACE 0.0.0.0 down
# 02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)
iface eth1 inet manual
pre-up ifconfig $IFACE up
post-down ifconfig $IFACE 0.0.0.0 down
iface lan1 inet dhcp
iface lan0 inet static
address 192.168.147.1
dns-nameservers 192.168.178.1
sysctl.conf は、
net.ipv4.ip_forward=1
明確に言うと、サブネットで複数のシステムを実行しており、それらは isc-dhcp-server/gateway コンボを介して問題なく動作しています。ブロックするファイアウォールもありません。debian net-install イメージを介してこのサブネットに新しいシステムをインストールできないだけです。
答え1
解決策を見つけました。 を使用する代わりに、ip route add default via 192.168.147.1
チップインする必要がありましたroute add default gw 192.168.147.1
。これでシステムをインストールできます。