natmap

更新时间:
2024-01-09
下载文档

natmap

添加或删除 NAT 映射。

格式

natmap {[add] | [del]} [WAN port] [LAN port] [LAN IP] [protocol] [ip_cnt]

说明

[root@sylixos:/root]# help natmap         
add or delete NAT maps.
eg. natmap add 80 80 192.168.1.2 tcp (map webserver as 192..2)
    natmap add 80 80 192.168.1.2 tcp 5 (map webserver as 192..2 ~ 192..6)
    natmap del 80 80 192.168.1.2 tcp (unmap webserver as 192..2)
natmap {[add] | [del]} [WAN port] [LAN port] [LAN IP] [protocol] [ip_cnt]
[root@sylixos:/root]# 

此命令有两种用法:

  • 参数 add:表示添加一个 NAT 映射。
  • 参数 del:表示删除一个 NAT 映射。protocol(协议)有 tcp 和 udp 两种。

样例

[root@sylixos:/root]# nats
NAT networking alias setting >>

     ALIAS        LOCAL START     LOCAL END
--------------- --------------- ---------------
192.168.7.2     192.168.7.2     192.168.7.20

NAT networking direct map setting >>

 ASS PORT  LOCAL PORT    LOCAL IP      IP CNT   PROTO
---------- ---------- --------------- -------- -------

NAT networking summary >>
    LAN: lo0
    WAN: en1
    Total Ass-node: 8192
    Used  Ass-node: 0
    IP Fragment: TCP-Enable UDP-Enable ICMP-Enable
[root@sylixos:/root]# natmap add 40 80 192.168.7.66 tcp
[root@sylixos:/root]# natmap add 40 80 192.168.7.77 udp
[root@sylixos:/root]# nats
NAT networking alias setting >>

     ALIAS        LOCAL START     LOCAL END
--------------- --------------- ---------------
192.168.7.2     192.168.7.2     192.168.7.20

NAT networking direct map setting >>

 ASS PORT  LOCAL PORT    LOCAL IP      IP CNT   PROTO
---------- ---------- --------------- -------- -------
        40         80 192.168.7.77           1 UDP
        40         80 192.168.7.66           1 TCP

NAT networking summary >>
    LAN: lo0
    WAN: en1
    Total Ass-node: 8192
    Used  Ass-node: 0
    IP Fragment: TCP-Enable UDP-Enable ICMP-Enable
[root@sylixos:/root]# natmap del 40 80 192.168.7.66 tcp
[root@sylixos:/root]# nats
NAT networking alias setting >>

     ALIAS        LOCAL START     LOCAL END
--------------- --------------- ---------------
192.168.7.2     192.168.7.2     192.168.7.20

NAT networking direct map setting >>

 ASS PORT  LOCAL PORT    LOCAL IP      IP CNT   PROTO
---------- ---------- --------------- -------- -------
        40         80 192.168.7.77           1 UDP

NAT networking summary >>
    LAN: lo0
    WAN: en1
    Total Ass-node: 8192
    Used  Ass-node: 0
    IP Fragment: TCP-Enable UDP-Enable ICMP-Enable
[root@sylixos:/root]#
文档内容是否对您有所帮助?
有帮助
没帮助