---
title: 修改Docker容器IP地址
description: "本模块是基于Docker容器启动脚本（以cfct脚本为例）进行修改Docker容器IP地址，如：cfct脚本中含有DOCKER_SUBNET变量。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/230RC2/armnative/kunpengcpsinstruction_32_0047.html
sourcePath: /source/zh/kunpengboostkithistory/230RC2/armnative/kunpengcpsinstruction_32_0047.html
indexId: 8dffcd9bf1898b64d52fe1e16a2e1344bf4cca4749a6bb5127718824556bef5285
---
# 修改Docker容器IP地址

本模块是基于Docker容器启动脚本（以cfct脚本为例）进行修改Docker容器IP地址，如：cfct脚本中含有DOCKER_SUBNET变量。

```
# DOCKER_SUBNET=172.18.0.0/16
```

此变量表示Docker容器的IP地址和掩码，通过以下命令用户可以自定义网络链接容器。

```
# docker network create ${DOCKER_SUBNET}${容器名}
```

Docker容器IP地址应选择没有使用的IP地址。
