H3C路由器配置NAT

system-view
System View: return to User View with Ctrl+Z.

[H3C]interface GigabitEthernet 0/0
[H3C-GigabitEthernet0/0]ip address XX.XX.XX.XX 255.255.255.0
(根据自己实际情况配置出口ip和掩码)
[H3C-GigabitEthernet0/0]quit

[H3C]interface GigabitEthernet 0/1
[H3C-GigabitEthernet0/1]ip address 192.168.1.1 255.255.255.0
[H3C-GigabitEthernet0/1]quit

[H3C]nat address-group ?
INTEGER<0-65535> NAT address group number
[H3C]nat address-group 1
[H3C-address-group-1]?
Address-group view commands:
address Add a NAT address group member
diagnostic-logfile Diagnostic log file configuration
dialer Specify Dial-on-Demand Routing(DDR) configuration
information
display Display current system information
logfile Log file configuration
monitor System monitor
ping Ping function
quit Exit from current command view
return Exit to User View
save Save current configuration
security-logfile Security log file configuration
tracert Tracert function
undo Cancel current setting

[H3C-address-group-1]address XX.XX.XX.XX XX.XX.XX.XX
(根据实际情况,配置地址转换的起始IP和结束IP,务必包括上述出口IP)
[H3C-address-group-1]quit
[H3C]acl number 2000
[H3C-acl-basic-2000]rule 0 permit source 192.168.1.0 0.0.0.255
[H3C-acl-basic-2000]quit

[H3C]interface GigabitEthernet 0/0
[H3C-GigabitEthernet0/0]nat outbound 2000 address-group 1
[H3C-GigabitEthernet0/0]quit

[H3C]ip ?
as-path Specify an AS path
community-list Specify a community list entry
extcommunity-list Specify an extended community-list entry
fast-forwarding IP fast-forwarding information
host Add a static host name-to-IPv4 address mapping
icmp Specify ICMP configuration information
local Apply a policy to locally generated packets
netstream NetStream function
pool Specify an IP address pool
prefix-list Specify an IPv4 prefix list
redirects Send ICMP Redirect packets
route-static Establish a static route
rpf-route-static Specify static multicast route
source Source binding function
ttl-expires Send ICMP Time Exceeded packets
unreachables Send ICMP Destination Unreachable packets
vpn-instance Specify a VPN instance

[H3C]interface GigabitEthernet 0/0
[H3C-GigabitEthernet0/0]undo shutdown
[H3C-GigabitEthernet0/0]quit
[H3C]%Sep 20 19:56:27:363 2014 H3C IFNET/3/PHY_UPDOWN: GigabitEthernet0/0 link status is up.
%Sep 20 19:56:27:364 2014 H3C IFNET/5/LINK_UPDOWN: Line protocol on the interface GigabitEthernet0/0 is up.

[H3C]interface GigabitEthernet 0/1
[H3C-GigabitEthernet0/1]undo shutdown
[H3C-GigabitEthernet0/1]quit
[H3C]%Sep 20 19:56:47:628 2014 H3C IFNET/3/PHY_UPDOWN: GigabitEthernet0/1 link status is up.
[H3C]save
[H3C]ip route-static 0.0.0.0 0.0.0.0 XX.XX.XX.X
(配置默认路由,一般是出口IP所在网段的网关)

[H3C]save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[flash:/startup.cfg]
(To leave the existing filename unchanged, press the enter key):
Validating file. Please wait…
Configuration is saved to device successfully.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值