Chinaunix首页 | 论坛 | 博客
  • 博客访问: 600412
  • 博文数量: 129
  • 博客积分: 6240
  • 博客等级: 准将
  • 技术积分: 1765
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-18 15:42
文章分类

全部博文(129)

文章存档

2015年(1)

2012年(3)

2011年(6)

2010年(14)

2009年(105)

我的朋友

分类: 系统运维

2009-11-04 16:11:18

想要实现如下的配置结果,具体的详细的配置命令是什么啊?如果现在对外网的IP变了(例如变成211.101.111.10),我要怎么改啊?请高手指教啊?小弟不胜感激啊~~~~

ip subnet-zero
!
!
!
interface Ethernet0/0
ip address 172.30.30.234 255.255.255.252
no ip directed-broadcast
ip nat outside
!
interface Serial0/0
no ip address
no ip directed-broadcast
shutdown
!
interface Ethernet1/0
ip address 192.168.100.1 255.255.255.0 secondary
ip address 192.168.0.1 255.255.255.0 secondary
ip address 211.101.8.10 255.255.255.224
no ip directed-broadcast
ip nat inside
!
ip nat pool castit 211.101.8.29 211.101.8.29 netmask 255.255.255.224
ip nat pool cisco 211.101.8.28 211.101.8.28 netmask 255.255.255.224
ip nat inside source list 1 pool castit overload
ip nat inside source list 2 pool cisco overload
ip classless
ip route 0.0.0.0 0.0.0.0 172.30.30.233
!
access-list 1 permit 192.168.100.0 0.0.0.255
access-list 2 permit 192.168.0.0 0.0.0.255
!
line con 0
transport input none
line aux 0
line vty 0 4

login
!
end

Router#
 
首先改变外网ip地址
config t
int e0
ip address 211.101.111.10  x.x.x.x  (你的子网掩码)
exit
删除原来的地址池
no ip nat pool castit 211.101.8.29 211.101.8.29 netmask 255.255.255.224
no ip nat pool cisco 211.101.8.28 211.101.8.28 netmask 255.255.255.224
重新建立地址池
ip nat pool castit x.x.x.x netmask x.x.x.x
ip nat pool cisco x.x.x. x.x.x.x netmask x.x.x.x
注意上面的开始公网地址和终止公网地址

地址池与acl 匹配

ip nat inside source list 1 pool castit overload
ip nat inside source list 2 pool cisco overload

end
copy run star
 
 
例二:
 
我有一台cisco2600路由器,用电信提供的固定IP来上网,现在我想把配置成两个网段,地址是是样划分的:
固定IP:222.219.183.55 掩码:255.255.255.0 网关:222.219.183.1
DNS:222.172.200.68(首选) 61.166.150.123(备用)
第一个网段:192.168.1--192.168.1.100 网关:192.168.1.1
第二个网段:10.141.69.1--10.141.69.251 网关:10.141.69.19
192.168.1.10(80号端口) 192.168.1.20(800)做web、ftp服务器
192.168.1.11做email服务器!
Router

interface fa0/1
ip add 222.219.183.55 255.255.255.0
ip nat outside
no sh

interface fa0/0.192
encapsulation dot1Q 192 native
ip add 192.168.1.1 255.255.255.128
ip nat inside
no sh
interface fa0/0.10
encapsulation dot1Q 10
ip add 10.141.69.19 255.255.255.0
ip nat inside
no sh

ip dhcp pool segment192
network 192.168.1.0 255.255.255.128
default-router 192.168.1.1
dns-server 222.172.200.68
ip dhcp pool segment10
network 10.141.69.0 255.255.255.0
default-router 10.141.69.19
dns-server 61.166.150.123

ip dhcp excluded-address 192.168.1.1 192.168.1.2
ip dhcp excluded-address 10.141.69.19
ip dhcp excluded-address 192.168.1.10
ip dhcp excluded-address 192.168.1.20
ip dhcp excluded-address 192.168.1.11

ip access-list extended nat
permit ip 192.168.1.0 0.0.0.127 any
permit ip 10.141.69.0 0.0.0.255 any
route-map nat permit 10
match ip address nat
ip nat inside source route-map nat 222.219.183.55  overload
ip nat inside static tcp 192.168.1.10 80 222.219.183.55 80
ip nat inside static tcp 192.168.1.11 135 222.219.183.55 135
ip nat inside static tcp 192.168.1.20 20 222.219.183.55 20
ip nat inside static tcp 192.168.1.20 21 222.219.183.55 21
ip nat inside static tcp 192.168.1.20 800 222.219.183.55 800

ip route 0.0.0.0 0.0.0.0 222.219.183.1
阅读(2130) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~