# TURN協議-穿透NAT的黑科技 > 簡易的架設TURN server(coturn) > 如何更改TURN server Listening的PORT  最近在架設Webrtc主機時,發現有些環境下因為NAT或是防火牆的關係,導致限制了許多的PORT,這時候就要透過TURN server來穿透NAT了。 簡易的架設TURN server 框架是依靠COTURN這個套件,這裡將我安裝及啟動的步驟記錄下來,也提供給需要的人一些指引。 ## :memo: 安裝環境 - [x] Linux Ubuntu 18.04 LTS - [x] 一個固定的對外IP - [x] 開啟3478 PORT對內連線 UDP跟TCP都要 (3478為TURN server 預設listening PORT) - [x] 一顆學習的心 ## :memo: 安裝步驟 ### Step 1:安裝coturn server - 更新軟體的最新資訊及列表 ```shell sudo apt-get update ``` - 安裝Coturn ```shell sudo apt-get install coturn ``` - 暫時停止Coturn服務,等完成配之後再重啟就好了 ```shell sudo systemctl stop coturn ``` - 新增一個負責進行TURN server的使用者 ```shell sudo adduser 使用者帳號 ``` - 把該使用者加入root權限 ```shell sudo usermod -a -G root 使用者帳號 ``` ### Step 2: 配置Coturn server - 備份config檔案 ```shell sudo cp /etc/turnserver.conf /etc/turnserver.conf.bak ``` - 修改turnserver.conf ```shell sudo vi /etc/turnserver.conf ``` - 未完待續
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up