一. 雙WAN口做靜態地址上網配置模板
1. 全局配置
ip nat start
ip dhcp enable
ip dhcp server dns 211.140.188.188 220.189.127.106
ip local pool dhcppool 192.168.1.2 192.168.1.228 255.255.255.0
ip local pool conflict-ip 5
ip dhcp server update arp
ip fast forward
!
2. WAN口配置
interface fei_1/1 //連電信接口
porttype L3
ip address 122.225.70.138 255.255.255.252 //和電信對接接口地址
description To_DianXin-100M
negotiation auto
interface-attribute wan //端口屬性更為wan。
ip nat outside //此接口加入NAT轉換,做出接口轉換
!
interface fei_1/2 //接移動線路
porttype L3
ip address 112.11.122.254 255.255.255.252
description To-Chinamobile-100M
negotiation auto
interface-attribute wan
ip nat outside
!
3. LAN口配置
interface fei_1/3
porttype L3
ip address 192.168.1.1 255.255.255.0
peer default ip pool dhcppool
negotiation auto
interface-attribute lan
ip dhcp mode server
ip dhcp server gateway 192.168.1.1
ip nat inside
!
4. NAT策略配置
acl standard number 10
rule 1 permit 192.168.1.0 0.0.0.255
!
ip nat inside source list 10 interface fei_1/1 //電信出口地址轉換
ip nat inside source list 10 interface fei_1/2 //移動出口地址轉換
!
5. 靜態路由配置
ip route 202.127.169.0 255.255.255.0 122.225.70.137 //到電信靜態路由。
ip route 202.127.172.0 255.255.255.0 122.225.70.137
ip route 202.128.105.0 255.255.255.0 122.225.70.137
ip route 202.152.180.0 255.255.255.0 122.225.70.137
ip route 203.156.244.0 255.255.255.0 122.225.70.137
ip route 203.169.165.0 255.255.255.0 122.225.70.137
ip route 219.137.112.0 255.255.255.0 122.225.70.137
ip route 222.184.114.0 255.255.255.0 122.225.70.137
ip route 218.75.60.0 255.255.255.0 122.225.70.137
ip route 218.75.61.0 255.255.255.0 122.225.70.137
ip route 218.75.62.0 255.255.255.0 122.225.70.137
ip route 61.129.96.128 255.255.255.255 122.225.70.137
ip route 211.156.219.0 255.255.255.0 122.225.70.137
ip route 60.190.63.0 255.255.255.0 122.225.70.137
ip route 61.144.209.195 255.255.255.255 122.225.70.137
ip route 61.174.30.0 255.255.255.0 122.225.70.137
ip route 122.225.0.0 255.255.128.0 122.225.70.137
ip route 182.61.128.0 255.255.255.0 122.225.70.137
ip route 115.227.64.0 255.255.192.0 122.225.70.137
ip route 202.107.231.0 255.255.255.0 122.225.70.137
ip route 211.156.194.0 255.255.255.0 122.225.70.137
ip route 211.95.81.0 255.255.255.0 122.225.70.137
ip route 218.75.56.0 255.255.255.0 122.225.70.137
ip route 218.75.57.0 255.255.255.0 122.225.70.137
ip route 218.75.58.0 255.255.255.0 122.225.70.137
ip route 218.75.63.0 255.255.255.0 122.225.70.137
ip route 219.141.0.0 255.255.0.0 122.225.70.137
ip route 220.189.249.0 255.255.255.0 122.225.70.137
ip route 220.189.251.0 255.255.255.0 122.225.70.137
ip route 220.189.253.0 255.255.255.0 122.225.70.137
ip route 220.189.255.0 255.255.255.0 122.225.70.137
ip route 220.191.220.0 255.255.255.0 122.225.70.137
ip route 60.190.133.0 255.255.255.0 122.225.70.137
ip route 61.153.0.0 255.255.0.0 122.225.70.137
ip route 202.96.97.241 255.255.255.255 122.225.70.137
ip route 202.96.97.240 255.255.255.255 122.225.70.137
ip route 121.9.213.0 255.255.255.0 122.225.70.137
ip route 122.224.206.0 255.255.255.0 122.225.70.137
ip route 0.0.0.0 0.0.0.0 112.11.122.253 //到移動線路默認路由
ip route 0.0.0.0 0.0.0.0 122.225.70.137 2 tag 150 //到電信備份出口默認路由
!
6. 保存配置
write!
二. PPPOE自動撥號上網配置模板
1. 全局配置
ip nat start
ip dhcp enable
ip dhcp server dns 211.140.188.188 211.140.13.188
ip local pool dhcppool 192.168.0.2 192.168.0.254 255.255.255.0
ip local pool conflict-ip 5
ip dhcp server update arp
ip fast forward
!
2. 撥號器配置
interface dialer1
ppp pap sent-username jxydzhjr699 password 123abc
dialer pool 1
ip nat outside
ip tcp adjust-mss 1460 //修改TCP連接中協商的的MSS值為1460,解決MTU值問題
!
3. WAN口配置
interface fei_1/1
porttype L3
interface-attribute wan
dialer pppoe-client-pool-member 1 1 permanent //配置永久撥號方式
!
4. LAN口配置
interface fei_1/2
porttype L3
ip address 192.168.0.1 255.255.255.0
peer default ip pool dhcppool
interface-attribute lan
ip dhcp mode server
ip dhcp server gateway 192.168.0.1
ip nat inside
!
5. NAT策略配置
acl standard number 10
rule 1 permit 192.168.0.0 0.0.0.255
!
ip nat inside source list 10 interface dialer1
!
6. 靜態路由配置
ip route 0.0.0.0 0.0.0.0 dialer1
!
三. 常用維護命令
1. 刪除配置文件,恢復出廠設置:
Zxr10#cd dir
Zxr10#delete startrun.dat
2. 查看設備告警信息:show logging ala
3. 查看版本文件: show version
4. 查看mac: show mac
5. 查看arp: show arp
6. 查看路由: show ip route
7. 查看端口信息: show interface fei_1/1