I’m having problems initializing the DHCP server, i got the follwing files:
/etc/sysconfig/network-scripts/ifcg-enp17s0
HWADDR=00:1F:29:EA:FF:48
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=enp17s0
UUID=7b883e1a-13ac-444b-96d8-52f01f5f4749
ONBOOT=yes
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPADDR=192.168.100.1
NETMASK=255.255.255.0
NETWORK=192.168.100.0
/etc/dhcp/dhcpd.conf
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
ddns-update-style interim;
allow booting;
allow bootp;
authoritative;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
subnet 192.168.100.0 netmask 255.255.255.0
{
interface enp17s0;
option routers 192.168.100.1;
option domain-name-servers 192.168.100.1;
option domain-name "example.com";
option subnet-mask 255.255.255.0;
range 192.168.100.100 192.168.100.254;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.100.1;
}
/etc/sysconfig/iptables
*nat
:PREROUTING ACCEPT [13036:1967731]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -o ens1 -j MASQUERADE
COMMIT
# ens1 modem
# enp17s0 local
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -i ens1 -o enp17s0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i enp17s0 -o ens1 -j ACCEPT
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
Anyone knows why it’s not working?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This comment has been deleted
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.