eth0, আমার অভ্যন্তরীণ ইন্টারফেসের একটি স্থির ঠিকানা রয়েছে 10.0.0.1। আমার একটি ইন্টারফেসও রয়েছে, p4p1আমার বাহ্যিক ইন্টারফেস হিসাবে অভিনয় করে। যদি এটি গুরুত্বপূর্ণ হয় তবে আমার বাহ্যিক ইন্টারফেসটি শারীরিকভাবে সংযুক্ত নয় এবং iptablesবন্ধ / এখনও লিখিত রয়েছে।
/etc/sysconfig/dhcpd:
DHCPDARGS=eth0
সাবনেট ধারা থেকে /etc/dhcpd.conf:
subnet 10.0.0.0 netmask 255.255.255.0 {
option routers 10.0.0.1;
option domain-name-servers 10.0.0.1;
option ntp-servers 10.0.0.1;
default-lease-time 86400; # 1 day
max-lease-time 604800; # 7 days
use-host-decl-names on;
ddns-updates on;
use-host-decl-names on;
allow unknown-clients;
ignore client-updates;
option domain-name "localdomain";
ddns-domainname "localdomain";
next-server 10.0.0.1;
filename "pxelinux.0";
group # known hosts
{
host host1.localdomain {hardware ethernet [REDACTED]; fixed-address host1.localdomain;}
host host2.localdomain {hardware ethernet [REDACTED]; fixed-address host2.localdomain;}
{
pool
{
one-lease-per-client true;
ping-check true;
range 10.0.0.51 10.0.0.60;
}
}
তাহলে, কেন আমি এখনও চালু হওয়ার পরে "কোনও সাবনেট ঘোষণা নয়" ত্রুটি বার্তা পাচ্ছি?
No subnet declaration for eth0 (10.0.0.1).
** Ignoring requests on eth0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface eth0 is attached. **
আপডেট 4/1 1900 ঘন্টা
আজ রাতের পরীক্ষাগুলির আগে:
[root@father ~]# ip addr show dev eth0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 90:e2:ba:2d:92:4d brd ff:ff:ff:ff:ff:ff
inet 10.0.0.1/24 brd 10.0.0.255 scope global eth0
inet6 fe80::92e2:baff:fe2d:924d/64 scope link
valid_lft forever preferred_lft forever
আচরণের কোনও পরিবর্তন ছাড়াই আমি আমার অভ্যন্তরীণ নেটওয়ার্কের আইপি ঠিকানাগুলিতে 192.168.100.0/24পরিবর্তনগুলির সাথে মিল রেখেছি /etc/dhcpd.conf।
[root@father ~]# ip addr show dev eth0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 90:e2:ba:2d:92:4d brd ff:ff:ff:ff:ff:ff
inet 192.168.100.1/24 brd 192.168.100.255 scope global eth0
inet6 fe80::92e2:baff:fe2d:924d/64 scope link
valid_lft forever preferred_lft forever
[root@father ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 p4p1
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 p4p1
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth0
এইযে! গেটওয়ে নেই! এটা একটা দিয়ে ফিক্স করা খুবই সহজ GATEWAY=192.168.0.1যে ifcfg-eth0এবং ifcfg-p4p1ফাইল। service network restartএবং...
[root@father ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 p4p1
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 p4p1
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 p4p1
সুতরাং, আমার একটি গেটওয়ে আছে service dhcpd startতবে একই ত্রুটিতে ব্যর্থ।
অন্যান্য নোট:
p4p1শারীরিকভাবে সংযুক্ত নয়।service dhcpd configtestবলেSyntax: OK। সুতরাং, এটি প্রায় অবশ্যই একটি ভুল জায়গায় থাকা বন্ধনীগুলির কেস নয়।
systemd: আপনি এক্সিকিউ লাইনে ইন্টারফেসটি নির্দিষ্ট/lib/systemd/system/dhcpd.serviceকরতে/etc/systemd/system/এবং অনুলিপি করতে পারেন :ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid eth0