Configuring some virtual IPs. In order it should: Should configure arp_ignore and arp_announce on all interfaces. Should define 3 new network scripts /etc/sysconfig/network-scripts/ifcfg-lo:[0-2]. Should bring up 3 new virtual interfaces. vip.pp ------ class vip_sysctl { exec { "reload-sysctl": command => "/sbin/sysctl -p /etc/sysctl.conf", refreshonly => true } Sysctl { notify => Exec["reload-sysctl"] } sysctl { "net.ipv4.conf.all.arp_ignore": value => 1 } sysctl { "net.ipv4.conf.eth0.arp_ignore": value => 1 } sysctl { "net.ipv4.conf.eth1.arp_ignore": value => 1 } sysctl { "net.ipv4.conf.all.arp_announce": value => 2 } sysctl { "net.ipv4.conf.eth0.arp_announce": value => 2 } sysctl { "net.ipv4.conf.eth1.arp_announce": value => 2 } } class vip { require vip_sysctl exec { "reload-sysctl": command => "/sbin/sysctl -p /etc/sysctl.conf", refreshonly => true } Sysctl { notify => Exec["reload-sysctl"] } sysctl { "net.ipv4.conf.all.arp_ignore": value => 1 } sysctl { "net.ipv4.conf.eth0.arp_ignore": value => 1 } sysctl { "net.ipv4.conf.eth1.arp_ignore": value => 1 } sysctl { "net.ipv4.conf.all.arp_announce": value => 2 } sysctl { "net.ipv4.conf.eth0.arp_announce": value => 2 } sysctl { "net.ipv4.conf.eth1.arp_announce": value => 2 } define loopback($ip => $title, $ifnum) { file {"/etc/sysconfig/network-scripts/ifcfg-lo:$ifnum": ensure => file, mode => 644, content => template("ifcfg-vip.erb"), notify => Exec["bring-up-lo"] } exec {"bring-up-lo": command => "/sbin/ifconfig lo:$ifnum $ip netmask 255.255.255.255 up", refreshonly => true } } loopback { "192.168.246.50": ifnum => 0 } loopback { "192.168.246.51": ifnum => 1 } loopback { "192.168.246.52": ifnum => 2 } } ifcfg-vip.erb ------------- DEVICE=lo:<%= ifnum %> BOOTPROTO=static IPADDR=<%= ip %> NETMASK=255.255.255.255 ONBOOT=yes
