好久没来了,今天晒一点我的配置给大家,希望能有所帮助。
![](https://i-blog.csdnimg.cn/blog_migrate/9db73c7022a8f9b0717c025d6a92da1e.png)
pppoe+nat+dhcp配置
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$t131$bEAgRIum8675KN.iGqRI90
!
no aaa new-model
!
!
ip cef
no ip dhcp use vrf connected
no ip dhcp conflict logging
ip dhcp excluded-address 192.168.1.1 192.168.1.20
ip dhcp excluded-address 192.168.2.1 192.168.2.20
ip dhcp excluded-address 192.168.3.1 192.168.3.20
ip dhcp excluded-address 192.168.4.1 192.168.4.20
ip dhcp excluded-address 192.168.5.1 192.168.5.20
ip dhcp excluded-address 192.168.6.1 192.168.6.20
ip dhcp excluded-address 192.168.7.1 192.168.7.20
!
ip dhcp pool 1L
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 211.167.97.67
lease 24
!
ip dhcp pool 2L-1
network 192.168.2.0 255.255.255.0
default-router 192.168.2.1
dns-server 211.167.97.67
lease 24
!
ip dhcp pool 2L-2
network 192.168.3.0 255.255.255.0
default-router 192.168.3.1
dns-server 211.167.97.67
lease 24
!
ip dhcp pool 3L-1
network 192.168.4.0 255.255.255.0
default-router 192.168.4.1
dns-server 211.167.97.67
lease 24
!
ip dhcp pool 3L-2
network 192.168.5.0 255.255.255.0
default-router 192.168.1.1
dns-server 211.167.97.67
lease 24
!
ip dhcp pool 4L-1
network 192.168.6.0 255.255.255.0
default-router 192.168.1.1
dns-server 211.167.97.67
lease 24
!
ip dhcp pool 4L-2
network 192.168.7.0 255.255.255.0
default-router 192.168.1.1
dns-server 211.167.97.67
lease 24
!
!
no ip bootp server
multilink bundle-name authenticated
vpdn enable
!
vpdn-group 1
request-dialin
protocol pppoe
l2tp tunnel receive-window 1024
!
!
!
!
username haha password 0 xxxx
archive
log config
hidekeys
!
!
!
!
!
interface GigabitEthernet0/0
no ip address
duplex auto
speed auto
pppoe enable
pppoe-client dial-pool-number 1
no cdp enable
!
interface GigabitEthernet0/1
no ip address
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
no cdp enable
!
interface GigabitEthernet0/1.1
encapsulation dot1Q 1 native
ip address 192.168.1.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
interface GigabitEthernet0/1.2
encapsulation dot1Q 2
ip address 192.168.2.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
interface GigabitEthernet0/1.3
encapsulation dot1Q 3
ip address 192.168.3.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
interface GigabitEthernet0/1.4
encapsulation dot1Q 4
ip address 192.168.4.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
interface GigabitEthernet0/1.5
encapsulation dot1Q 5
ip address 192.168.5.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
interface GigabitEthernet0/1.6
encapsulation dot1Q 6
ip address 192.168.6.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
interface GigabitEthernet0/1.7
encapsulation dot1Q 7
ip address 192.168.7.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
interface Dialer1
ip address negotiated
ip mtu 1492
ip nat outside
ip virtual-reassembly
encapsulation ppp
no ip mroute-cache
dialer pool 1
dialer-group 1
ppp authentication pap callin
ppp pap sent-username xxxxx password 0 xxxxx
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/0
ip route 0.0.0.0 0.0.0.0 Dialer1 permanent
!
!
no ip http server
ip nat inside source list 1 interface Dialer1 overload
!
access-list 1 permit any
access-list 101 permit ip any any
dialer-list 1 protocol ip permit
!
!
control-plane
!
!
line con 0
exec-timeout 5 10
password hehe
log config
hidekeys
!
!
!
!
!
interface GigabitEthernet0/0
no ip address
duplex auto
speed auto
pppoe enable
pppoe-client dial-pool-number 1
no cdp enable
!
interface GigabitEthernet0/1
no ip address
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
no cdp enable
!
interface GigabitEthernet0/1.1
encapsulation dot1Q 1 native
ip address 192.168.1.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
interface GigabitEthernet0/1.2
encapsulation dot1Q 2
ip address 192.168.2.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
interface GigabitEthernet0/1.3
encapsulation dot1Q 3
ip address 192.168.3.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
interface GigabitEthernet0/1.4
encapsulation dot1Q 4
ip address 192.168.4.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
interface GigabitEthernet0/1.5
encapsulation dot1Q 5
ip address 192.168.5.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
interface GigabitEthernet0/1.6
encapsulation dot1Q 6
ip address 192.168.6.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
interface GigabitEthernet0/1.7
encapsulation dot1Q 7
ip address 192.168.7.1 255.255.255.0
ip nat inside
ip virtual-reassembly
!
interface Dialer1
ip address negotiated
ip mtu 1492
ip nat outside
ip virtual-reassembly
encapsulation ppp
no ip mroute-cache
dialer pool 1
dialer-group 1
ppp authentication pap callin
ppp pap sent-username xxxxx password 0 xxxxx
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/0
ip route 0.0.0.0 0.0.0.0 Dialer1 permanent
!
!
no ip http server
ip nat inside source list 1 interface Dialer1 overload
!
access-list 1 permit any
access-list 101 permit ip any any
dialer-list 1 protocol ip permit
!
!
control-plane
!
!
line con 0
exec-timeout 5 10
password hehe
login
line aux 0
line vty 0 4
exec-timeout 5 2
password haha
login
!
scheduler allocate 20000 1000
!
end
line aux 0
line vty 0 4
exec-timeout 5 2
password haha
login
!
scheduler allocate 20000 1000
!
end
转载于:https://blog.51cto.com/mzt1258/191814