Tải bản đầy đủ (.doc) (31 trang)

Tài liệu PPP over Ethernet with VPN docx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (151.41 KB, 31 trang )

PPP over Ethernet with VPN

Tác giả Lê Anh Đức
PPP over Ethernet kết hợp với VPN

Mô tả:
Ở topo trên, ta có, R3 sẽ làm PPPoE client, còn R1 sẽ làm PPPoE server, thực hiện kết nối với các mạng
trong Internet với ISP làm router giả lập ISP. Router R2 là router ở chi nhánh, thực hiện NAT để cho mang
private ra internet. Chú ý: Các router R3, R1 là các route 2600, chạy IOS version 12.2 trở lên. Kết hợp với
đó, ta sẽ tạo một tunnel private giữa R3 và R2, để các traffic từ các mạng LAN trong nội bộ giữa 2 chi
nhánh sẽ sử dụng để liên lạc với nhau qua môi trường Internet.

Cấu hình:
R1
!
version 12.2
!
hostname R1
!
vpdn enable
!
vpdn-group 1
accept-dialin
protocol pppoe
virtual-template 1
!
!
!
!
voice call carrier capacity active
!


!
!
!
!
!
!
!
!
mta receive maximum-recipients 0
!
!
!
!
interface Loopback1
ip address 203.162.3.2 255.255.255.255
!
interface Ethernet0/0
no ip address
half-duplex
pppoe enable
!
interface Serial0/0
ip address 203.20.20.2 255.255.255.252
no fair-queue
!
interface Virtual-Template1
ip unnumbered Loopback1
!
ip classless
ip route 0.0.0.0 0.0.0.0 203.20.20.1

ip http server
!
!
!
call rsvp-sync
!
!
mgcp profile default
!
dial-peer cor custom
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end

R2
Building configuration

Current configuration : 1290 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec

no service password-encryption
!
hostname R2
!
!
memory-size iomem 10
ip subnet-zero
!
!
!
!
crypto isakmp policy 10  tạo các chính sách xác minh cho VPN (phải đồng bộ)
hash md5
authentication pre-share
crypto isakmp key cisco address 203.162.3.1  tạo key để xác minh
!
!
crypto ipsec transform-set vnpro esp-des  tạo chính sách mã hoá cho luống traffic trong tunnel
!
crypto map lee 10 ipsec-isakmp  tạo crypto map để match traffic
set peer 203.162.3.1
set transform-set vnpro
match address 120
!
!
!
voice call carrier capacity active
!
!
!

!
!
!
!
!
!
mta receive maximum-recipients 0
!
!
!
!
interface Ethernet0/0
ip address 10.10.2.1 255.255.255.0
ip nat inside
half-duplex
!
interface Serial0/0
ip address 203.30.30.2 255.255.255.252
ip nat outside
no fair-queue
crypto map lee  áp crypto map vào interface S0/0
!
interface Serial0/1
no ip address
shutdown
!
ip nat inside source route-map nonat interface Serial0/0 overload tạo NAT
ip classless
ip route 0.0.0.0 0.0.0.0 203.30.30.1
ip http server

!
!
access-list 120 permit ip 10.10.2.0 0.0.0.255 10.10.1.0 0.0.0.255 xác định traffic được mã hoá
access-list 130 deny ip 10.10.2.0 0.0.0.255 10.10.1.0 0.0.0.255 miễn NAT cho traffic trong tunnel
access-list 130 permit ip any any
!
route-map nonat permit 10
match ip address 130
!
call rsvp-sync
!
!
mgcp profile default
!
dial-peer cor custom
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end

R3
Building configuration


*Mar 1 01:25:49.913: %SYS-5-CONFIG_I: Configured from console by console
Current configuration : 1523 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
!
memory-size iomem 10
ip subnet-zero
!
!
!
vpdn enable bật PPPoE
!
vpdn-group 1 tạo vpdn group để giao tiếp với server
request-dialin  xác định đây là PPPoE client
protocol pppoe
!
!
crypto isakmp policy 10  tạo chính sách xác minh
hash md5
authentication pre-share
crypto isakmp key cisco address 203.30.30.2  tạo key để xác minh
!
!
crypto ipsec transform-set vnpro esp-des  xác định giải thuật mã hoá cho traffic trong tunnel

!
crypto map lee 10 ipsec-isakmp  tạo crypto map để xác định traffci được mã hoá
set peer 203.30.30.2
set transform-set vnpro
match address 120
!
!
!
voice call carrier capacity active
!
!
!
!
!
!
!
!
!
mta receive maximum-recipients 0
!
!
!
!
interface Loopback0
ip address 10.10.1.1 255.255.255.0
ip nat inside
!
interface Ethernet0/0
no ip address
half-duplex

pppoe enable bật PPPoE trên interface nối với server
pppoe-client dial-pool-number 1  sử dụng Dieler để giao tiếp với PPPoE server
!
interface Serial0/0
no ip address
shutdown
no fair-queue
!
interface Dialer1  xây dựng interface Dialer
mtu 1492
ip address 203.162.3.1 255.255.255.0
ip nat outside
encapsulation ppp
dialer pool 1
dialer-group 1
crypto map lee  gán crypto map vào interface này
!
ip nat inside source route-map nonat interface Dialer1 overload sử dụng PAT
ip classless
ip route 0.0.0.0 0.0.0.0 203.162.3.2
ip http server
!
!
access-list 120 permit ip 10.10.1.0 0.0.0.255 10.10.2.0 0.0.0.255  xác định traffic được bảo vệ
access-list 130 deny ip 10.10.1.0 0.0.0.255 10.10.2.0 0.0.0.255  miễn NAT cho traffic trong tunnel
access-list 130 permit ip any any
dialer-list 1 protocol ip permit
!
route-map nonat permit 10
match ip address 130

!
call rsvp-sync
!
!
mgcp profile default
!
dial-peer cor custom
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end

ISP
Building configuration

01:17:31: %SYS-5-CONFIG_I: Configured from console by console
Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!

hostname ISP
!
!
ip subnet-zero
!
!
!
interface Ethernet0
no ip address
no ip directed-broadcast
shutdown
!
interface Serial0
ip address 203.20.20.1 255.255.255.252
no ip directed-broadcast
no ip mroute-cache
no fair-queue
clockrate 64000
!
interface Serial1
ip address 203.30.30.1 255.255.255.252
no ip directed-broadcast
clockrate 64000
!
ip classless
ip route 10.10.1.0 255.255.255.0 203.20.20.2  ISP sử dụng static routing
ip route 10.10.2.0 255.255.255.0 203.30.30.2
ip route 203.162.0.0 255.255.0.0 203.20.20.2
!
!

line con 0
transport input none
line aux 0
line vty 0 4
!
end

Thực hiện:
1. Cấu hình PPPoE:
PPP over Ethernet là một sự phát triển dựa trên kỹ thuật PPP truyền thống. PPPoE cung cấp khả năng kết
nối nhiều host trong mạng qua một thiết bị chuyển mạch vào một DSLAM, để cung cấp một kết nối
PPPoE, mỗi phiên PPP phải học địa chỉ Ethernet của remote peer và thiết lập một danh định duy nhất.
PPPoE gồm 2 pha: Discovery và Session:
• Discovery: khi một router muốn khởi tạo 1 phiên PPPoE, nó phải xác định địa chỉ MAC của
thiết bị bên kia (Lát nửa debug sẽ cho thấy điều này) và thiết lập một PPPoE Session-ID. Trong
quá trình này, CPE sẽ tìm các DSLAM và chọn một cái để sử dụng. Khi quá trình này chấm dứt,
cả CPE và DSLAM đều sẽ có thông tin mà nó sử dụng để xây dựng kết nối PPPoE. Khi
PPPsession được thiết lập thì cả CPE và DSLAM sẽ phải phân phát tài nguyên của mình cho một
PPP virtual interface.
• Session: khi được thiết lập thì dữ liệu sẽ được gửi.
Để cấu hình, ta thực hiện các bước sau:

PPPoE server(R1):
R1(config)#vpdn enable  bật PPPoE
R1(config)#vpdn-group 1
R1(config-vpdn)#accept-dialin xác định đây là PPPoE server
R1(config-vpdn-acc-in)#protocol pppoe
R1(config-vpdn-acc-in)#virtual-template 1  sử dụng virtual để giao tiếp với client
R1(config-vpdn-acc-in)#exit
R1(config)#int lo1

R1(config-if)#ip add 203.162.3.2 255.255.255.255
R1(config-if)#int e0/0
R1(config-if)#pppoe enable  bật PPPoE trên interface kết nối với client
R1(config)#int virtual-template 1  tạo virtual template
R1(config-if)#ip unnumbered lo1


PPPoE client(R3):
R3(config)#vpdn enable
R3(config)#vpdn-group 1
R3(config-vpdn)#request-dialin  xác định PPPoE client
R3(config-vpdn-req-in)#protocol pppoe
R3(config)#int e0/0
R3(config-if)#pppoe enable  bật PPPoE trên interface nối với server
R3(config-if)#pppoe-client dial-pool-number 1  sử dụng dialer 1 để giao tiếp với server
R3(config-if)#exit
R3(config)#int dialer 1
R3(config-if)#mtu 1492
R3(config-if)#ip add 203.162.3.1 255.255.255.0
R3(config-if)#ip nat outside
R3(config-if)#encapsulation ppp
R3(config-if)#dialer pool 1
R3(config-if)#dialer-group 1
R3(config-if)#exit
R3(config)#dialer-list 1 protocol ip permit

2. Cấu hình VPN:
Để thực hiện cấu hình VPN giữa 2 chi nhánh qua môi trường DSL, ta cũng thực hiện tương tự như các
bài lab VPN trước:
R2:

R2(config)#crypto isakmp policy 10
R2(config-isakmp)#hash md5
R2(config-isakmp)#authentication pre-share
R2(config-isakmp)#exit
R2(config)#crypto isakmp key cisco address 203.162.3.1
R2(config)#crypto ipsec transform-set vnpro esp-des
R2(cfg-crypto-trans)#exit
R2(config)#crypto map lee 10 ipsec-isakmp
% NOTE: This new crypto map will remain disabled until a peer
and a valid access list have been configured.
R2(config-crypto-map)#set peer 203.162.3.1
R2(config-crypto-map)#set transform-set vnpro
R2(config-crypto-map)#match address 120
R2(config-crypto-map)#exit
R2(config)#int s0/0
R2(config-if)#crypto map lee
R2(config)#ip nat inside source route-map nonat interface s0/0 overload
R2(config)#access-list 120 permit ip 10.10.2.0 0.0.0.255 10.10.1.0 0.0.0.255
R2(config)#access-list 130 deny ip 10.10.2.0 0.0.0.255 10.10.1.0 0.0.0.255
R2(config)#access-list 130 permit ip any any
R2(config)#route-map nonat
R2(config-route-map)#match ip address 130

R3:
R3(config)#crypto isakmp policy 10
R3(config-isakmp)#authentication pre-share
R3(config-isakmp)#hash md5
R3(config-isakmp)#exit
R3(config)#crypto isakmp key cisco address 203.30.30.2
R3(config)#crypto ipsec transform-set vnpro esp-des

R3(cfg-crypto-trans)#exit
R3(config)#crypto map lee 10 ipsec-isakmp
% NOTE: This new crypto map will remain disabled until a peer
and a valid access list have been configured.
R3(config-crypto-map)#set peer 203.30.30.2
R3(config-crypto-map)#set transform-set vnpro
R3(config-crypto-map)#match address 120
R3(config-crypto-map)#exit
R3(config)#int dialer 1
R3(config-if)#crypto map lee
R3(config)#ip nat inside source route-map nonat interface dialer 1 overload
R3(config)#access-list 120 permit ip 10.10.1.0 0.0.0.255 10.10.2.0 0.0.0.255
R3(config)#access-list 130 deny ip 10.10.1.0 0.0.0.255 10.10.2.0 0.0.0.255
R3(config)#access-list 130 permit ip any any
R3(config)#route-map nonat
R3(config-route-map)#match ip address 130
Kiểm tra:
1. Kiểm tra VPN:
Ta sử dụng các lệnh show để xem thông tin về VPN:
R3:
R3#sh crypto map
Crypto Map "lee" 10 ipsec-isakmp
Peer = 203.30.30.2
Extended IP access list 120
access-list 120 permit ip 10.10.1.0 0.0.0.255 10.10.2.0 0.0.0.255
Current peer: 203.30.30.2
Security association lifetime: 4608000 kilobytes/3600 seconds
PFS (Y/N): N
Transform sets={ vnpro, }
Interfaces using crypto map lee:

Virtual-Access1
Dialer1



R3#sh crypto isakmp policy
Protection suite of priority 10
encryption algorithm: DES - Data Encryption Standard (56 bit keys).
hash algorithm: Message Digest 5
authentication method: Pre-Shared Key
Diffie-Hellman group: #1 (768 bit)
lifetime: 86400 seconds, no volume limit
Default protection suite
encryption algorithm: DES - Data Encryption Standard (56 bit keys).
hash algorithm: Secure Hash Standard
authentication method: Rivest-Shamir-Adleman Signature
Diffie-Hellman group: #1 (768 bit)
lifetime: 86400 seconds, no volume limit

R3#sh crypto ipsec transform-set
Transform set vnpro: { esp-des }
will negotiate = { Tunnel, },

R2:
R2#sh crypto isakmp policy
Protection suite of priority 10
encryption algorithm: DES - Data Encryption Standard (56 bit keys).
hash algorithm: Message Digest 5
authentication method: Pre-Shared Key
Diffie-Hellman group: #1 (768 bit)

lifetime: 86400 seconds, no volume limit
Default protection suite
encryption algorithm: DES - Data Encryption Standard (56 bit keys).
hash algorithm: Secure Hash Standard
authentication method: Rivest-Shamir-Adleman Signature
Diffie-Hellman group: #1 (768 bit)
lifetime: 86400 seconds, no volume limit

R2#sh crypto ipsec transform-set
Transform set vnpro: { esp-des }
will negotiate = { Tunnel, },

R2#sh crypto map
Crypto Map "lee" 10 ipsec-isakmp
Peer = 203.162.3.1
Extended IP access list 120
access-list 120 permit ip 10.10.2.0 0.0.0.255 10.10.1.0 0.0.0.255
Current peer: 203.162.3.1
Security association lifetime: 4608000 kilobytes/3600 seconds
PFS (Y/N): N
Transform sets={ vnpro, }
Interfaces using crypto map lee:
Serial0/0
Tunnel0

2. Kiểm tra PPPoE:
Ta sử dụng các lệnh show và debug để xem quá trình tạo kết nối và trao đổi dữ liệu như thế nào giữa
client và server:
R3#sh int
Ethernet0/0 is up, line protocol is up

Hardware is AmdP2, address is 0005.5e96.2cc0 (bia 0005.5e96.2cc0)
MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,
reliability 192/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:41, output 00:00:05, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue :0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
47 packets input, 4752 bytes, 0 no buffer
Received 6 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 input packets with dribble condition detected
317 packets output, 21918 bytes, 0 underruns
251 output errors, 0 collisions, 1 interface resets
0 babbles, 0 late collision, 0 deferred
251 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
Virtual-Access1 is up, line protocol is up
Hardware is Virtual Access interface
MTU 1492 bytes, BW 56 Kbit, DLY 100000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, loopback not set
DTR is pulsed for 5 seconds on reset
Interface is bound to Di1 (Encapsulation PPP)
LCP Open

Listen: CDPCP
Open: IPCP
Last input 00:00:09, output never, output hang never
Last clearing of "show interface" counters 00:02:56
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue :0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
39 packets input, 544 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
39 packets output, 616 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 output buffer failures, 0 output buffers swapped out
0 carrier transitions
Dialer1 is up, line protocol is up (spoofing)
Hardware is Unknown
Internet address is 203.162.3.1/24
MTU 1492 bytes, BW 56 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, loopback not set
DTR is pulsed for 1 seconds on reset
Interface is bound to Vi1
Last input never, output never, output hang never
Last clearing of "show interface" counters 00:34:56
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/0/16 (active/max active/max total)

Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 42 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
36 packets input, 504 bytes
36 packets output, 576 bytes
Bound to:
Virtual-Access1 is up, line protocol is up
Hardware is Virtual Access interface
MTU 1492 bytes, BW 56 Kbit, DLY 100000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, loopback not set
DTR is pulsed for 5 seconds on reset
Interface is bound to Di1 (Encapsulation PPP)
LCP Open
Listen: CDPCP
Open: IPCP
Last input 00:00:04, output never, output hang never
Last clearing of "show interface" counters 00:03:01
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue :0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
41 packets input, 572 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
41 packets output, 648 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 output buffer failures, 0 output buffers swapped out

0 carrier transitions
Loopback0 is up, line protocol is up
Hardware is Loopback
Internet address is 10.10.1.1/24
MTU 1514 bytes, BW 8000000 Kbit, DLY 5000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation LOOPBACK, loopback not set
Last input never, output never, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue :0/0 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 packets output, 0 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 output buffer failures, 0 output buffers swapped out

R3#sh vpdn

%No active L2TP tunnels

%No active L2F tunnels

%No active PPTP tunnels

PPPoE Tunnel and Session Information Total tunnels 1 sessions 1


PPPoE Tunnel Information

VPDN group: 1
Session count: 1

PPPoE Session Information
SID RemMAC LocMAC Intf VASt OIntf VLAN/
VP/VC
1 0004.c052.7ce0 0005.5e96.2cc0 Vi1 UP Et0/0

R3#debug vpdn pppoe-data  bật debug PPPoE
PPPoE data packets debugging is on
R3#debug ip nat  và NAT
IP NAT debugging is on
R3#ping  thực hiện ping mở rộng với source là Private LAN
Protocol [ip]:
Target IP address: 203.30.30.2
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y

×