How to allocate a fixed IP for the docker's container with the host network segment in the virtual machine centos7

I am a rookie, the use of docker encountered a problem, but also hope that the great god of many instructions operating environment:

虚拟机中的Centos7 ip 10.1.2.249 GW 10.1.2.254 docker 1.8 建立container test1 利用的工具pipwork 

Expect to assign fixed IP 10.1.2.248 to test1

Attempts have been made
1, http://www.infoq.com/cn/articles/docker-network-and-pipework-open-source-explanation-practice This article uses pipwork to assign fixed IP methods
2, http://www.xiaomastack.com/2015/02/06/docker-static-ip/ this way of the script

The result: container can not ping other machines within the LAN can ping the host, through the tcpdump packet capture, is the mac address of the container sent to the routing, according to my personal understanding of the host should be mac routing, do not know with me The centos is the virtual machine is relevant, if so there is no good way to solve this problem. Thank you

  • Memories | Which internet open courses may change your life?
  • How to achieve more for the container to add a card, so that the container has two NIC?
  • Using the network namespace of Linux to simulate the docker bridge network mode to build a virtual network environment
  • Docker for Mac container IP configuration issues
  • Docker network related issues
  • On the container ip problem
  • Flannel network configuration problem
  • How the host simply and efficiently accesses docker 1.9 comes with all the containers in the overlay network (including other hosts)
  • 2 Solutions collect form web for “How to allocate a fixed IP for the docker's container with the host network segment in the virtual machine centos7”

    The amount of experiment on the physical machine using pipwork no problem. The The The The But if any big cattle can solve the virtual machine in the emergence of this problem, but also hope a lot of guidance

    And host with the network segment a little trouble, but through swarm + overlay network mode,
    You can configure a good container interconnected network, you can ping each other with the host name

    Heads up! This alert needs your attention, but it's not super important.