- lxc-create -n puppetmaster01 -t debian
- lxc-create -n puppetclient01 -t debian
- /etc/default/lxc-net
- find subnet defined by LXC_NETWORK
- vi /var/lib/lxc/puppetmaster01/config
- add ip addr ending in .100 to subnet
- for example, lxc.network.ipv4 = 10.0.1.100/24
- vi /var/lib/lxc/puppetclient01/config
- add ip add ending in .101 to subnet
- for example, lxc.network.ipv4 = 10.0.1.101/24
- lxc-start -d -n puppetmaster01
- don't forget the "-d" or you'll be stuck in tty session
- lxc-start -d -n puppetclient01
- lxc-attach -n puppetmaster
- apt-get install puppetmaster
- lxc-attach -n puppetclient01
- apt-get install puppet
- vi /etc/hosts and add entry "puppet" to point at pmaster
WARNING: for distro "saucy" as your container/host system, dnsmasq is broken, vms can not get DHCP IP address from dnsmasq. To attempt to fix, try:
- sudo iptables -t mangle -A POSTROUTING -o lxcbr0 -p udp --dport bootpc -j CHECKSUM --checksum-fill
- refresh vm IP
- stop and start vm,
- or kill existing dhclient process on vm, and run dhclient by hand
- pkill dhclient
- dhclient -v eth0
- If that doesn't help your vm to get an IP address from dnsmasq
- delete the iptables rule you just created
- iptables -L -t mangle -n --line-numbers
- show existing rule numbers in left column
- iptables -t mangle -D POSTROUTING <rule #>
- for example, iptables -t mangle -D POSTROUTING 1
No comments:
Post a Comment
Note: only a member of this blog may post a comment.