Skip to content

Instantly share code, notes, and snippets.

@utarn
Created July 30, 2019 07:49
Show Gist options
  • Select an option

  • Save utarn/56ad1e3667f60d56fb71749d6e819ca5 to your computer and use it in GitHub Desktop.

Select an option

Save utarn/56ad1e3667f60d56fb71749d6e819ca5 to your computer and use it in GitHub Desktop.
Sample & Simple dhcpd.conf
default-lease-time 86400; # 24 hours
max-lease-time 172800; # 48 hours
subnet 192.168.13.0 netmask 255.255.255.0 {
option domain-name "myrmutsb.com";
option domain-name-servers 8.8.8.8, 8.8.4.4;
option routers 192.168.13.1;
option subnet-mask 255.255.255.0;
range 192.168.13.101 192.168.13.200;
}
host debian-8 {
hardware ethernet 52:54:00:61:e4:e7;
fixed-address 192.168.13.128;
}
@utarn
Copy link
Copy Markdown
Author

utarn commented Jul 30, 2019

  1. Enable ip forwarding
    Add net.ipv4.ip_forward=1 to /etc/sysctl.conf
    sysctl -p
  2. Add 192.168.13.0/24 to trusted zone
    firewall-cmd --permanent --zone=trusted --add-source=192.168.13.0/24
  3. Configure NAT
    firewall-cmd --permanent --direct --passthrough ipv4 -t nat -I POSTROUTING -o ens192 -j MASQUERADE -s 192.168.13.0/24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment