if the slice is not created with this option, it will not be reset @
runtime.
for ip in addresses:
vserverimpl.netadd(self.ctx, ip)
for ip in addresses:
vserverimpl.netadd(self.ctx, ip)
- def set_ipaddresses_config(self, addresses):
+ def set_ipaddresses_config(self, addresses, add_loopback=True):
ip_addresses = addresses.split(",")
# add looopback interface
ip_addresses = addresses.split(",")
# add looopback interface
- if not ip_addresses.__contains__("127.0.0.1"):
+ if not ip_addresses.__contains__("127.0.0.1") and add_loopback:
ip_addresses.append("127.0.0.1")
i = 0
ip_addresses.append("127.0.0.1")
i = 0
# create emtpy nodev files to silent "No device specified for" warnings
self.config.update("interfaces/%d/nodev" % i, "")
i += 1
# create emtpy nodev files to silent "No device specified for" warnings
self.config.update("interfaces/%d/nodev" % i, "")
i += 1
- while self.config.unset("interfaces/%d/ip" % i) and self.config.update("interfaces/%d/nodev" % i):
+ while self.config.unset("interfaces/%d/ip" % i) and self.config.update("interfaces/%d/nodev" % i, ""):
i += 1
self.set_ipaddresses(ip_addresses)
i += 1
self.set_ipaddresses(ip_addresses)
-while getopts "t:" opt ; do
+ISOLATE=false
+while getopts "it:" opt ; do
case $opt in
t)
TYPE="$OPTARG"
;;
case $opt in
t)
TYPE="$OPTARG"
;;
- $_VSERVER $NAME build -m skeleton --context $USERID \
+ if [ "$ISOLATE" = "true" ] ; then
+ $_VSERVER $NAME build -m skeleton --context $USERID \
+ --interface nodev:`hostname -i` \
+ --flags persistent,~info_init
+ else
+ $_VSERVER $NAME build -m skeleton --context $USERID \
--interface nodev:`hostname -i` \
--interface nodev:`hostname -i` \
- --interface nodev:127.0.0.1 \
+ --interface nodev:127.0.0.1 \
--flags persistent,~info_init
--flags persistent,~info_init
RETVAL=$?
DIR=$__CONFDIR/$NAME
if [ $RETVAL -ne 0 ] ; then
RETVAL=$?
DIR=$__CONFDIR/$NAME
if [ $RETVAL -ne 0 ] ; then
echo default > $DIR/apps/init/mark
# Set persistent for the network context
echo default > $DIR/apps/init/mark
# Set persistent for the network context
- echo persistent,lback_allow > $DIR/nflags
+ if [ "$ISOLATE" = "true" ]; then
+ echo persistent,lback_allow,hide_lback,lback_remap > $DIR/nflags
+ else
+ echo persistent,lback_allow > $DIR/nflags
+ fi
# Set default capabilities
echo "CAP_NET_RAW" > $DIR/bcapabilities
# Set default capabilities
echo "CAP_NET_RAW" > $DIR/bcapabilities