deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-data-original http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb-data-original http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-data-original http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-data-original http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
对于KVM虚拟机,可以直接在创建虚拟机的时候勾上NAT,这时候就会自动为虚拟机分配一个虚拟的子网并且虚拟机可以通过nat连接到外部网络,基本上是开箱即用。同时也支持端口映射,具体可参考proxmox.com/wiki/Network_Model">官方wiki下的QEMU port redirection。但之前在使用的过程中,发现这个端口映射并不是很稳定。同时虽然这种方法很简单,但是虚拟机之间是隔离的,无法互通数据,这样就非常不灵活。
同时,LXC虚拟机是没有这种开箱即用的NAT的。
最近把我的OVH独服重装了下,打算用Proxmox开点VM来用,省得一直吃灰(雾,安装很简单,毕竟是OVH提供的模板,但是,这玩意每次登陆都会有个蛋疼的提示(You do not have a valid subscription for this server. Please visit www.proxmox" href="http://www.senra.me/tag/proxmox/" rel="tag">proxmox.com to get a list of available options.),而且找了半天没找到有关的地方,然后去官网看了下订阅的价格,呵呵呵,我还是自己想办法吧……
proxmox" href="http://www.senra.me/tag/proxmox/" rel="tag">Proxmox VE 4将3代的OpenVZ支持去除换成了LXC,算是跟随趋势吧,但是LXC和OpenVZ还是有挺多不同的,在权限上更是如此,而网上最多的还是OVZ相关的教程,LXC的是真的少,不过一直以来没需求,所以没怎么折腾,最近在搞内网,所以为了用Tunnel还是得把TUN/TAP支持打开。
Change/Create the file that it looks exactly like this:
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]
respawn
exec /sbin/agetty -8 tty1 38400
Save the changes and shutdown/start the container via Console.