华为路由器配置NAT地址转换访问外网
小编:动力软件园 时间:2015-04-24 10:18:13
组网需求
如图1所示,Router的出接口GE0/0/1的IP地址为200.100.1.2/24,接口Eth0/0/1的IP地址为192.168.0.1/24。连接Router出接口GE0/0/1的对端IP地址为200.100.1.1/24。
内网用户通过Router的出接口GE0/0/1做Easy IP 地址转换访问外网。
操作步骤
Router的配置
#
sysname Router //修改设备名称
#
interface GigabitEthernet0/0/0
ip address 200.100.1.2 255.255.255.252 // 配置运营商给的30位ip地址
#
acl number 2000 //配置允许进行NAT转换的内网地址段192.168.0.0/24
rule 5 permit source 192.168.0.0 0.0.0.255
#
interface Ethernet0/0/1
ip address 192.168.0.1 255.255.255.0 //配置内网网关地址
#
interface GigabitEthernet0/0/0
ip address 200.100.1.2 255.255.255.0
nat outbound 2000 //在出接口GE0/0/0上做Easy IP 方式的NAT
#
ip route-static 0.0.0.0 0.0.0.0 200.100.1.1 //配置默认路由,保证出接口到对端路由可达,这里一定要配置运营商的ip地址。运营商还需要做回程路由。ok
#
查看配置结果:
[Huawei]dis cur
[V200R003C00]
#
board add 0/1 2FE
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone Indian Standard Time minus 05:13:20
clock daylight-saving-time Day Light Saving Time repeating 12:32 9-1 12:32 11-23 00:00 2005 2005
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
acl number 2000
rule 1 permit source 192.168.0.0 0.0.255.255
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
firewall zone Local
priority 15
#
interface Ethernet0/0/0
#
interface Ethernet0/0/1
#
interface Ethernet0/0/2
#
interface Ethernet0/0/3
#
interface Ethernet0/0/4
#
interface Ethernet0/0/5
#
interface Ethernet0/0/6
#
interface Ethernet0/0/7
#
interface Ethernet1/0/0
#
interface Ethernet1/0/1
#
interface GigabitEthernet0/0/0
ip address 200.100.1.2 255.255.255.252
nat outbound 2000
#
interface GigabitEthernet0/0/1
ip address 192.168.0.1 255.255.255.0
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 200.100.1.1
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
请注意版权!转载须写明出处:动力软件园 http://www.pw88.com
排行榜