Current configuration : 836 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname router
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$XOtQ$ojfTfsKfyKxZtTWNaz5mR/
!
no network-clock-participate slot 1
no network-clock-participate wic 0
no aaa new-model
no ip subnet-zero
no ip cef
!
!
!
no ftp-server write-enable
!
!
!
!
interface FastEthernet0/0
ip address 172.30.6.6 255.255.255.252
ip accounting output-packets
speed 10
half-duplex
!
interface FastEthernet0/1
ip address 211.101.7.161 255.255.255.224
ip access-group 120 in
duplex auto
speed auto
!
ip classless
ip route 0.0.0.0 0.0.0.0 172.30.6.5
no ip http server
!
!
line con 0
line aux 0
line vty 0 4
password 7 0112020952050F1C355E4F1D1617
login
!
!
!
end
Current configuration : 1019 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname router
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$XOtQ$ojfTfsKfyKxZtTWNaz5mR/
!
no network-clock-participate slot 1
no network-clock-participate wic 0
no aaa new-model
no ip subnet-zero
no ip cef
!
!
!
no ftp-server write-enable
!
!
!
!
interface FastEthernet0/0
ip address 192.168.0.3 255.255.255.0 secondary
ip address 172.30.6.6 255.255.255.252
ip accounting output-packets
ip nat inside
speed 10
half-duplex
!
interface FastEthernet0/1
ip address 211.101.7.161 255.255.255.224
ip access-group 120 in
ip nat outside
duplex auto
speed auto
!
ip nat pool rout 211.101.7.162 211.101.7.191 netmask 255.255.255.224
ip nat inside source list 2 pool rout
ip classless
ip route 0.0.0.0 0.0.0.0 172.30.6.5
no ip http server
!
access-list 2 permit 192.168.0.0 0.0.0.255
!
line con 0
line aux 0
line vty 0 4
password 7 0112020952050F1C355E4F1D1617
login
!
!
!
end
这样就可以上网拉作者: tyrone 时间: 2007-7-4 17:16
我现在就是想把vpn 去掉,直接用路由器来上网,想在路由器上配个192.168.0.3的地址,然后把网关设成192.168.0.3来上网。作者: wgq1001 时间: 2007-7-9 14:45
interface FastEthernet0/1
ip address 211.101.7.161 255.255.255.224
ip access-group 120 in ip nat outside
duplex auto
speed auto
!
使用网络地址翻译(NAT)
NAT(Network Address Translation)起到将内部私有地址翻译成外部合法的全局地址的功能,它使得不具有合法IP地址的用户可以通过NAT访问到外部Internet.
当建立内部网的时候,建议使用以下地址组用于主机,这些地址是由Network Working Group(RFC 1918)保留用于私有网络地址分配的.
?; Class A:10.1.1.1 to 10.254.254.254
?; Class B:172.16.1.1 to 172.31.254.254
?; Class C:192.168.1.1 to 192.168.254.254
命令描述如下:
任务 命令
定义一个标准访问列表 access-list access-list-number permit source [source-wildcard]
定义一个全局地址池 ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length} [type rotary]
建立动态地址翻译 ip nat inside source {list {access-list-number | name} pool name [overload] | static local-ip global-ip}
指定内部和外部端口 ip nat {inside | outside}
如下图所示,
路由器的Ethernet 0端口为inside端口,即此端口连接内部网络,并且此端口所连接的网络应该被翻译,Serial 0端口为outside端口,其拥有合法IP地址(由NIC或服务提供商所分配的合法的IP地址),来自网络10.1.1.0/24的主机将从IP地址池c2501中选择一个地址作为自己的合法地址,经由Serial 0口访问Internet。命令ip nat inside source list 2 pool c2501 overload中的参数overload,将允许多个内部地址使用相同的全局地址(一个合法IP地址,它是由NIC或服务提供商所分配的地址)。命令ip nat pool c2501 202.96.38.1 202.96.38.62 netmask 255.255.255.192定义了全局地址的范围。
设置如下:
ip nat pool c2501 202.96.38.1 202.96.38.62 netmask 255.255.255.192
interface Ethernet 0
ip address 10.1.1.1 255.255.255.0
ip nat inside
!
interface Serial 0
ip address 202.200.10.5 255.255.255.252
ip nat outside
!
ip route 0.0.0.0 0.0.0.0 Serial 0
access-list 2 permit 10.0.0.0 0.0.0.255
! Dynamic NAT
!
ip nat inside source list 2 pool c2501 overload
line console 0
exec-timeout 0 0
!
line vty 0 4
end作者: kzm_sh 时间: 2007-7-26 12:02 标题: 你能提供一下,你的网络拓扑,就路由这块就可以!(包括端口连接的! 作者: kzm_sh 时间: 2007-7-26 12:07
你的F0/0是连在内网里吗!作者: 毒藥 时间: 2007-8-13 17:29 作者: suning.wang 时间: 2007-8-23 15:57
楼主的想法不好。那有直接用路由器上网的。到时候一有个人把IP改成网关。看你楼主还想不想混了。呵呵。。。你这样的拓扑跟我原来用过的一摸一样。真怀疑你是不是曾经跟我在一个单位混过。呵呵。好好琢磨吧。有防火墙做NAT还是比路由器好些的。我做是实验。作者: xysh860 时间: 2007-9-25 14:52 标题: 我个人的观点 router
>
>enable
#config terminal
(config)#ip nat inside source list 1 permit pool nat-pool overload
(config)#access-list 1 permit 192.168.0.0 0.0.0.255
(config)#ip nat pool nat-pool 211.101.7.161 211.161.7.190 netmask 255.255.255.224