Command Line Reference
IP Service
NAT Configuration
13 min
nat configuration nat configuration show nat config show nat config \[command] show nat config \[purpose] display nat configuration information \[view] system view \[use cases] sonic# show nat config global values admin mode disabled global timeout 600 secs tcp timeout 86400 secs udp timeout 300 secs static entries nat type ip protocol global ip global port local ip local port twice nat id \ pool entries pool name global ip range global port range \ nat bindings binding name pool name access list nat type twice nat id \ nat zones port zone \ ethernet8 0 loopback0 0 vlan4000 0 show nat translations show nat translations \[command] show nat translations \[purpose] display nat translations information \[view] system view \[use cases] sonic# show nat translations static nat entries 2 static napt entries 0 dynamic nat entries 0 dynamic napt entries 0 static twice nat entries 0 static twice napt entries 0 dynamic twice nat entries 0 dynamic twice napt entries 0 total snat/snapt entries 1 total dnat/dnapt entries 1 total entries 2 protocol source destination translated source translated destination \ all 192 168 1 1 1 1 1 1 all 1 1 1 1 192 168 1 1 show nat translations count show nat translations count \[command] show nat translations count \[purpose] display nat translations counts \[view] system view \[use cases] sonic# show nat translations count static nat entries 2 static napt entries 0 dynamic nat entries 0 dynamic napt entries 0 static twice nat entries 0 static twice napt entries 0 dynamic twice nat entries 0 dynamic twice napt entries 0 total snat/snapt entries 1 total dnat/dnapt entries 1 total entries 2 show nat statistics show nat statistics \[command] show nat statistics \[purpose] display nat hit statistics \[view] system configuration view \[use cases] sonic# show nat statistics protocol source destination packets bytes \ all 192 168 1 1 0 0 all 1 1 1 1 0 0 nat zone nat zone 0 3 \[command] nat zone 0 3 \[purpose] configure nat zone \[parameter] parameter parameter description description nat zone interface domain the default value is 0 when a non zero value is configured, the nat conversion function is enabled \[view] interface view \[use cases] sonic(config if 8)# nat zone 1 nat enable nat enable \[command] nat enable no nat enable \[purpose] enable nat function \[view] system configuration view \[use cases] sonic(config)# nat enable nat static basic global ip local ip {snat|dnat} tcp|udp|icmp|all \[extendable|normal] \[comment] nat static basic global ip local ip {snat|dnat} tcp|udp|icmp|all \[extendable|normal] \[comment] \[command] nat static basic global ip local ip {snat|dnat} tcp|udp|icmp|all \[extendable|normal] \[comment] no nat static basic global ip local ip tcp|udp|icmp|all \[purpose] configure static nat function \[parameter] parameter parameter description description global ip global ip local ip local ip snat for this session, the private network side needs to initiate the establishment first dnat for this session, the public network side needs to initiate the establishment first tcp|udp|icmp|all configure corresponding conversions for different protocol types extendable support reusing private network port numbers normal normal configuration without involving port number reuse comment add a note (up to 63 characters) for the configured nat session \[view] system configuration view \[use cases] sonic(config)# nat static basic 1 1 1 1 192 168 1 1 snat tcp test1 nat static {tcp|udp} global ip global port local ip local port {snat|dnat} \[extendable|normal] \[comment] nat static {tcp|udp} global ip global port local ip local port {snat|dnat} \[extendable|normal] \[comment] \[command] nat static {tcp|udp} global ip global port local ip local port {snat|dnat} \[extendable|normal] \[comment] no nat static {tcp|udp} global ip global port local ip local port \[purpose] configure static napt function \[parameter] parameter parameter description description global ip global ip local ip local ip snat for this session, the private network side needs to initiate the establishment first dnat for this session, the public network side needs to initiate the establishment first tcp|udp|icmp|all configure corresponding conversions for different protocol types extendable support reusing private network port numbers normal normal configuration without involving port number reuse comment add a note (up to 63 characters) for the configured nat session \[view] system configuration view \[use cases] sonic(config)# nat static tcp 1 1 1 1 2000 192 168 1 1 3000 snat test1 nat pool {pool name} start ip \[end ip] nat pool {pool name} start ip \[end ip] \[command] nat pool {pool name} start ip \[end ip] no nat pool {pool name} \[purpose] configure dynamic address pool \[parameter] parameter parameter description description pool name address pool name start ip start ip of address pool end ip end ip of address pool \[view] system configuration view \[use cases] sonic(config)# nat pool test 1 1 1 1 1 1 1 2 nat binding {binding name} {pool name} \[acl name] nat binding {binding name} {pool name} \[acl name] \[command] nat binding {binding name} {pool name} \[acl name] no nat binding {binding name} \[acl name] \[purpose] bind dynamic address pool \[parameter] parameter parameter description description binding name bind name pool name dynamic address pool name acl name acl table name \[view] system configuration view \[use cases] sonic(config)# nat binding bing1 test acl1
