测试当前网络的 NAT 类型(STUN)

renovate[bot] edd96fb230 dep: Update ABP to v7.2.2 2 vuotta sitten
.github dbaf4d2fee dep: Update TargetFramework 2 vuotta sitten
Build 111e4f4adc housekeeping: Update build scripts 3 vuotta sitten
NatTypeTester edd96fb230 dep: Update ABP to v7.2.2 2 vuotta sitten
NatTypeTester.Models edd96fb230 dep: Update ABP to v7.2.2 2 vuotta sitten
NatTypeTester.ViewModels edd96fb230 dep: Update ABP to v7.2.2 2 vuotta sitten
STUN 689044b465 dep: Update dependency Microsoft.VisualStudio.Validation to v17.6.11 2 vuotta sitten
UnitTest db70b7e2ed dep: Update dependency Microsoft.NET.Test.Sdk to v17.5.0 2 vuotta sitten
pic 8425c658f5 housekeeping: Update RFC5780_4.5.png 3 vuotta sitten
.editorconfig 0b857a128c housekeeping: Update .editorconfig 3 vuotta sitten
.gitattributes 93159da643 housekeeping: Update framework to .net5.0 4 vuotta sitten
.gitignore 22a115f142 style: Update code style 3 vuotta sitten
LICENSE 3fe3bbf5c4 Initial commit 7 vuotta sitten
NatTypeTester.sln e1ad9c5627 refactor: drop console 3 vuotta sitten
NuGet.Config 75422b3531 housekeeping: Update to .net6.0 4 vuotta sitten
README.md 52fc5d1ff6 housekeeping: Update README.md 3 vuotta sitten
build.ps1 dbaf4d2fee dep: Update TargetFramework 2 vuotta sitten
common.props 22a115f142 style: Update code style 3 vuotta sitten

README.md

NatTypeTester

Channel | Status -|- CI | CI Stun.Net | NuGet.org

RFC supports

Internet Protocol

  • IPv4
  • IPv6

Transmission Protocol

  • UDP
  • TCP
  • TLS-over-TCP
  • DTLS-over-UDP

Preview

RFC3489

![](pic/RFC3489.png)

RFC5389

Binding Test

Checking for UDP Connectivity with the STUN Server ![](pic/RFC5780_4.2.png)

Mapping Behavior

Determining NAT Mapping Behavior ![](pic/RFC5780_4.3.png)

Filtering Behavior

Determining NAT Filtering Behavior ![](pic/RFC5780_4.4.png)

Combining Tests

![](pic/RFC5780_4.5.png)

STUN Server

Docker

docker pull hmbsbige/stunserver
docker run -d --restart=always --net=host --name=stunserver hmbsbige/stunserver --mode full --primaryinterface $IP1 --altinterface $IP2