拓扑如下:
ISP 配置:
R3#sh run
Building configuration...
Current configuration : 1064 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
no ip dhcp use vrf connected
ip dhcp excluded-address 10.0.0.3 255.255.255.0
!
ip dhcp pool dhcpr3
network 10.0.0.0 255.255.255.0
!
!
vpdn enable
!
username cisco password 0 cisco
username user password 0 user
bba-group pppoe global
virtual-template 1
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
pppoe enable group global
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
pppoe enable group global
!
interface Virtual-Template1
ip address 10.0.0.3 255.255.255.0
peer default ip address dhcp-pool dhcpr3
ppp authentication chap
ppp ipcp dns 8.8.8.8
!
!
no ip http server
no ip http secure-server
control-plane
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
-----------------------------------------------------------------------------
Cisco拔号
R2#sh run
Building configuration...
Current configuration : 1052 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
vpdn enable
!
interface FastEthernet0/0
ip address 192.168.0.2 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
pppoe enable
pppoe-client dial-pool-number 1
!
interface Dialer1
ip address negotiated
ip nat outside
ip virtual-reassembly
encapsulation ppp
dialer pool 1
ppp authentication chap callin
ppp chap hostname user
ppp chap password 0 user
!
!
no ip http server
no ip http secure-server
ip route 0.0.0.0 0.0.0.0 Dialer1
!
!
ip nat inside source list 1 interface Dialer1 overload
!
access-list 1 permit 192.168.0.0 0.0.0.255
!
!
!
!
control-plane
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
-------------------------------------------------------------------------
让内网(192.168.0.0/24)主机可以与外网通信
R1#show run
Building configuration...
Current configuration : 720 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip routing
!
!
no ip cef
no ip domain lookup
interface FastEthernet0/0
ip address 192.168.0.1 255.255.255.0
no ip route-cache
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
no ip route-cache
shutdown
duplex auto
speed auto
!
!
ip default-gateway 192.168.0.2
no ip http server
no ip http secure-server
!
control-plane
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
公司内部ping ISP
nat 转换
用windows拔号:
内部网络访问外部主机