Failed to create private network

I have read the documents: Private Networks

I have try to create private network like following steps, but http://127.0.0.1:5001/webui has no response.

# ipfs --version
ipfs version 0.4.19-dev

# ipfs-swarm-key-gen > ./ipfs/swarm.key

# IPFS_PATH=./ipfs LIBP2P_FORCE_PNET=1 ipfs init
initializing IPFS node at ./ipfs
generating 2048-bit RSA keypair...done
peer identity: QmdCD4hNowgkHr7DsnR1S9Aj8d5SzZJj321UHDcLwxAW1d
to get started, enter:

        ipfs cat /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme

# IPFS_PATH=./ipfs LIBP2P_FORCE_PNET=1 ipfs bootstrap rm --all
removed /dnsaddr/bootstrap.libp2p.io/ipfs/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN
removed /dnsaddr/bootstrap.libp2p.io/ipfs/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa
removed /dnsaddr/bootstrap.libp2p.io/ipfs/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb
removed /dnsaddr/bootstrap.libp2p.io/ipfs/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt
removed /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ
removed /ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM
removed /ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64
removed /ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu
removed /ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd
removed /ip6/2400:6180:0:d0::151:6001/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu
removed /ip6/2604:a880:1:20::203:d001/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM
removed /ip6/2604:a880:800:10::4a:5001/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64
removed /ip6/2a03:b0c0:0:1010::23:1001/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd

# IPFS_PATH=./ipfs LIBP2P_FORCE_PNET=1 ipfs bootstrap add /ip4/127.0.0.1/tcp/4001/ipfs/QmdCD4hNowgkHr7DsnR1S9Aj8d5SzZJj321UHDcLwxAW1d
added /ip4/127.0.0.1/tcp/4001/ipfs/QmdCD4hNowgkHr7DsnR1S9Aj8d5SzZJj321UHDcLwxAW1d

# IPFS_PATH=./ipfs LIBP2P_FORCE_PNET=1 ipfs daemon
Initializing daemon...
go-ipfs version: 0.4.19-dev-b5c7a1fca
Repo version: 7
System version: amd64/darwin
Golang version: go1.11.5
Swarm is limited to private network of peers with the swarm key
Swarm key fingerprint: 1842a061b4239d9cc1310f2375988805
Swarm listening on /ip4/10.147.18.1/tcp/4001
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/192.168.0.235/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /p2p-circuit
Swarm announcing /ip4/10.147.18.1/tcp/4001
Swarm announcing /ip4/127.0.0.1/tcp/4001
Swarm announcing /ip4/192.168.0.235/tcp/4001
Swarm announcing /ip6/::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
WebUI: http://127.0.0.1:5001/webui
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Daemon is ready

The webui is hosted on the public IPFS, so when you try to reach it from the private network it couldn’t find it.
So in order to have access to it , you will have to create a public node , open the webUi, Pin it to the node and then make the node part of the private network. This should work. Let me know.

i build ipfs-webui from source, add it to my private network, and modified go-ipfs source code corehttp/webui.go, replaced webui’s ipfs path. then i works for me.