Network
# ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9000 inet 134.75.xxx.yyy netmask 255.255.255.0 broadcast 134.75.xxx.255 eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9000 inet 192.168.4.1 netmask 255.255.255.0 broadcast 192.168.4.255
Install
yum -y install dnsmasq
Config
/etc/sysctl.d/99-ipfwd.conf
net.ipv4.ip_forward = 1
/etc/dnsmasq.d/net.conf
interface=eth1 except-interface=lo,eth0 bind-interfaces listen-address=127.0.0.1 listen-address=192.168.4.1 #domain-needed bogus-priv #no-resolv resolv-file=/etc/resolv.conf #filterwin2k expand-hosts domain=local local=/local/ #domain= #local= dhcp-option=option:netmask,255.255.255.0 dhcp-option=option:router,192.168.4.1 dhcp-option=option:dns-server,192.168.4.1 dhcp-option=option:ntp-server,141.223.182.106 # ntp.postech.ac.kr dhcp-range=192.168.4.194,192.168.4.253,5m dhcp-lease-max=252 dhcp-leasefile=/var/lib/dnsmasq/local.leases
Before | After |
---|---|
/usr/lib/systemd/system/dnsmasq.service [Unit] Description=DNS caching server. After=network.target [Service] ExecStart=/usr/sbin/dnsmasq -k [Install] WantedBy=multi-user.target | /usr/lib/systemd/system/dnsmasq.service [Unit] Description=DNS caching server. After=network-online.target Wants=network-online.target [Service] ExecStart=/usr/sbin/dnsmasq -k [Install] WantedBy=multi-user.target systemctl daemon-reload |
/etc/firewalld/zones/internal.xml
<?xml version="1.0" encoding="utf-8"?> <zone> <short>Internal</short> <interface name="eth1"/> <service name="ssh"/> <service name="dns"/> <service name="dhcp"/> </zone>
/etc/firewalld/zones/public.xml
<?xml version="1.0" encoding="utf-8"?> <zone> <short>Public</short> <interface name="eth0"/> <service name="ssh"/> <masquerade/> <forward/> </zone>