2016-10-16 cloud-computing►docker docker设置静态ip docker设置静态ip脚本12345678910111213141516171819202122232425#/bin/bashif [ -z $1 ] || [ -z $2 ] || [ -z $3 ] || [ -z $4 ];then echo "*****Input the necessary parameters: CONTAINERID IP MASK GATEWAY" echo "*****Call the script like: sh manual_con_static_ip.sh b0e18b6a4432 192.168.5.123 24 192.168.5.1" exitfiCONTAINERID=$1SETIP=$2SETMASK=$3GATEWAY=$4pid=`docker inspect -f '{{.State.Pid}}' $CONTAINERID`mkdir -p /var/run/netnsfind -L /var/run/netns -type l -deleteln -s /proc/$pid/ns/net /var/run/netns/$pidip link add A type veth peer name Bbrctl addif br0 Aip link set A upip link set B netns $pidip netns exec $pid ip link set dev B name eth0ip netns exec $pid ip link set eth0 upip netns exec $pid ip addr add $SETIP/$SETMASK dev eth0ip netns exec $pid ip route add default via $GATEWAY Newer centos6 安装oracle11g Older ubuntu 17.04 install redis