I would like to set a container use the vpn for only network interface.I have used the pptpsetup and pon make a pptp connection works, and got a ppp0 interface.Now, I want all internet connection in the systemd-nspawn container go through the ppp0 .How can I make it work?
How to use systemd-nspawn with pptp?
linux;vpn;chroot;pptp;systemd nspawn
systemd-nspawn --network-interface=ppp0ppp0 will disappear from the host namespace.  You can't share one IP address with a container and not your other IP addresses.  (Apart from doing NAT).It looks like this might require a very recent kernel though.  http://www.spinics.net/lists/netdev/msg339236.htmlOR (machine is created after ppp0):systemd-nspawn --private-networkip link set dev ppp0 netns $PIDwhere $PID is the pid in the host namespace of a process in container, obtained usingP=$(machinectl $MACHINE_NAME show --property=Leader)PID=${P#Leader=}and $MACHINE_NAME is the value passed to the -M option of systemd-nspawn