创建本地帐号与密码 [H3C]local-user admin [H3C]password simple #######
[H3C]service-type terminal (设置服务类型为terminal) [H3C]level 3 (设置用户优先级为3) eth0/0口接外网,eth0/1口接内网 配置外网接口 [H3C]int eth0/0
[2811-Ethernet0/0]ip add x.x.x.x 255.255.255.252 [2811-Ethernet0/0]q [H3C] 配置内网接口 [H3C]int eth0/1
[2811-Ethernet0/1]ip add 192.168.0.254 255.255.255.0 [2811-Ethernet0/0]q [H3C]
配置DHCP和DNS [H3C]dhcp server ip-pool 1
[2811-dhcp-pool-1]network 192.168.0.0 255.255.255.128
[2811-dhcp-pool-1]dns-list x.x.x.x x.x.x.x(运营商的dns server1和server2) [2811-dhcp-pool-1]gateway-list 192.168.0.254(eth0/1的ip地址) 配置nat
[H3C]nat address-group 1 x.x.x.x(用户NAT的地址池,就是eth0/0的公网ip) [H3C]acl number 3000
[H3C -acl-adv-3000]rule 0 permit source 192.168.0 0.0.0.127(配置允许进行NAT转换的内网地址段) [H3C]rule 1 deny [H3C]q 配置缺省路由
[H3C]ip route-static 0.0.0.0 0.0.0.0 x.x.x.x preference 60(外网网关,eth0/0对端的ip) [H3C]
配置在出接口上进行NAT转换 [H3C]int et0/0
[2811-Ethernet0/0]nat outbound 3000 address-group 1 [H3C]save