This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
docs:lxc [2013-11-18 23:10] glen [Resources] add funtoo |
docs:lxc [2013-11-18 23:45] glen [Vserver comparision] |
||
---|---|---|---|
Line 48: | Line 48: | ||
| vserver test start | lxc-start -n test -d | | | vserver test start | lxc-start -n test -d | | ||
| vserver test stop | lxc-stop -n test | | | vserver test stop | lxc-stop -n test | | ||
+ | |||
+ | ==== config for network ==== | ||
+ | |||
+ | static networking, set ''VSERVER=yes'' in guest ''/etc/sysconfig/system'' to disable all network configuration by guest. | ||
+ | |||
+ | - uses ''macvlan'' | ||
+ | - that interface is NOT visible on host | ||
+ | - you can't filter it from host's firewall | ||
+ | - you HAVE to set mac. If not - on every container start you'll have different one (your router will not pass the traffic). | ||
+ | |||
+ | first boot with ''hwaddr'' line disabled, look what the random address was assigned, set it in config. | ||
+ | |||
+ | also you may use some generation techniques like these (assuming the ip is ''192.168.2.160''): | ||
+ | |||
+ | <code bash> | ||
+ | $ printf "02:00:%x:%x:%x:%x" 192 168 2 160 | ||
+ | 02:00:c0:a8:2:a0 | ||
+ | </code> | ||
+ | |||
+ | <file bash> | ||
+ | lxc.network.type = macvlan | ||
+ | lxc.network.flags = up | ||
+ | #lxc.network.hwaddr = 00:16:c0:a8:3:34 | ||
+ | lxc.network.link = eth0 | ||
+ | lxc.network.macvlan.mode = bridge | ||
+ | lxc.network.name = eth0 | ||
+ | lxc.network.ipv4 = 192.168.2.160/23 | ||
+ | lxc.network.ipv4.gateway = 192.168.2.1 | ||
+ | </file> |