Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- install dhcp server:
- yum install dhcp
- select nic for the dhcp:
- nano /etc/sysconfig/dhcpd
- ----------------------------------------------------------------------
- DHCPDARGS=eth1
- ----------------------------------------------------------------------
- copy sample config file:
- cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
- configure dhcp scope:
- nano /etc/dhcp/dhcpd.conf
- ----------------------------------------------------------------------
- option domain-name “domain.local”;
- option domain-name-servers 8.8.8.8, 8.8.4.4;
- default-lease-time 600;
- max-lease-time 7200;
- log-facility local7;
- subnet 192.168.0.0 netmask 255.255.255.0 {
- range 192.168.0.100 192.168.0.150;
- option domain-name-servers 8.8.8.8;
- option routers 192.168.0.1;
- }
- ----------------------------------------------------------------------
- start dhcp:
- /etc/init.d/dhcpd start
- enable ip forwarding:
- echo 1 > /proc/sys/net/ipv4/ip_forward
- nano /etc/sysctl.conf
- ---------------------------------------------
- net.ipv4.ip_forward = 1
- ---------------------------------------------
- configure iptables:
- iptables -I FORWARD 1 -i eth1 -o eth0 -j ACCEPT
- iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
- service iptables save
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement