Configuring Puppet

puppet server ip addr:
  eth0 =           -> internet connection
  eth1 =     -> lan connection

puppet client ip addr:
 puppet1 =
 puppet2 =
 puppet3 =
 puppet4 =
 puppet5 =

Setup puppet server :

1. setup ipaddress puppet server
    root@puppetmaster~# vim /etc/network.interface
    setup static ip,write this
    auto eth0
    iface eth0 inet static
    gateway   ==> ip ADSL / gateway server

    auto eth1
    iface eth1 inet static

2. setup name server and host (for DNS and DHCP next step)
    root@puppetmaster~# vim /etc/resolv.conf

    root@puppetmaster~# vim /etc/hosts puppetmaster

3. setup internet router, on puppet server

    edit sysctl
    root@puppetmaster~# vim /etc/sysctl.conf

    unmark/ write


    setup nat
    root@puppetmaster~# iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE

    save nat config
    root@puppetmaster~# iptables-save > /etc/iptables

    make firewall run when system start
    root@puppetmaster~# touch /etc/init.d/iptables
    root@puppetmaster~# vim /etc/init.d/iptables

    write this
    echo 1 > /proc/sys/net/ipv4/ip_forward
    iptables-restore < /etc/iptables.conf

    make the script executable
    root@puppetmaster~# chmod +x /etc/init.d/iptables

    make the script run, when boot
    root@puppetmaster~# update-rc.d iptables defaults

 4. setup DNS server

     root@puppetmaster~# apt-get install bind9
     root@puppetmaster~# vim /etc/bind/named.conf.local

    add this lines, be careful for the semicolon ";"

    zone "" IN { type master; notify no; file "/etc/bind/"; };  
    zone "" IN { type master; notify no; file "/etc/bind/rev-192.168.5"; };

    make and rev-192.168.5 files
    root@puppetmaster~# touch /etc/bind/{,rev-192.168.5}
    edit the file and write this
    root@puppetmaster~# vim /etc/bind/

    $TTL 7200;
    @         IN     SOA (
                          20110127; serial

     ns1                 A
     puppetmaster  A
     puppet1          A
     puppet2          A
     puppet3          A
     puppet4          A
     puppet5          A

root@puppetmaster~# vim /etc/bind/rev-192.168.5

    $TTL 7200;
    @         IN     SOA ( 
                          20110127; serial

     10        IN      PTR
     10        IN      PTR 
     11        IN      PTR
     12        IN      PTR
     13        IN      PTR
     14        IN      PTR
     15        IN      PTR

 root@puppetmaster~# /etc/init.d/bind9 start
 root@puppetmaster~# dig @localhost

if got an error, you can check using
 root@puppetmaster~#  tail -n 50 /var/log/daemon.log
 root@puppetmaster~#named-checkzone /etc/bind/

5. setup DHCP server

install DHCP server
root@puppetmaster~# apt-get install dhcp3-server

edit dhcp config file at:
root@puppetmaster~# vim /etc/dhcp3/dhcpd.conf

ddns-update-style none;
option domain-name "";
option domain-name-servers;
default-lease-time 600;
max-lease-time 7200;

subnet netmask {
           option routers;
           option subnet-mask;
           default-lease-time 600;
           max-lease-time 7200;

# configuring ip client based on mac address

host puppet1 {
           hardware ethernet 08:00:27:81:6f:80;   <== based on your mac addr

root@puppetmaster~# /etc/init.d/dhcp3-server start

Ok,the DNS server is done now install the puppet master at the
and puppet client.

1. you need epel repo for installing puppet

yum install puppet-server

2. configure puppet.conf


Popular posts from this blog

authentication failure using SSH pam_unix(sshd:auth): authentication failure;

Howto configure SPLUNK Universal Forwarder

openvpn howto make OCSP server using OpenSSL [Part2]