Giải Pháp  Hạ Tầng Mạng
 
Giải pháp sử dụng mã nguồn mở Vyatta thay thế Cisco và Fortinet (Phần V - OPENVPN)
15:54 | 21/06/2011
Site-to-Site Mode with Pre-Shared Secret


1/ Cấu hình trên router V1

Tạo pre-shared key

vyatta@V1$  vpn openvpn-key generate /root/secret
copy tập tin /root/secret vào thư mục /root của router V2
vyatta@V1#  scp /root/secret  root@87.65.43.21:/root/

Tạo interface vtun0

vyatta@V1# set interfaces openvpn vtun0
vyatta@V1# set interfaces openvpn vtun0 local-address 192.168.1.1

vyatta@V1# set interfaces openvpn vtun0 mode site-to-site


vyatta@V1# set interfaces openvpn vtun0 remote-address 192.168.1.2


vyatta@V1# set interfaces openvpn vtun0 remote-host 87.65.43.21


vyatta@V1# set interfaces openvpn vtun0 shared-secret-key-file /root/secret


vyatta@V1# commit

vyatta@V1# show interfaces openvpn vtun0
local-address 192.168.1.1
mode site-to-site
remote-address 192.168.1.2
remote-host 87.65.43.21
shared-secret-key-file /root/secret

Cấu hình static route cho mạng 192.168.101.0/24

vyatta@V1# set protocols static interface-route 192.168.101.0/24
next-hop-interface vtun0


vyatta@V1# commit

2/ Cấu hình trên router V2

vyatta@V2# set interfaces openvpn vtun0
vyatta@V2# set interfaces openvpn vtun0 local-address 192.168.1.2

vyatta@V2# set interfaces openvpn vtun0 mode site-to-site


vyatta@V2# set interfaces openvpn vtun0 remote-address 192.168.1.1


vyatta@V2# set interfaces openvpn vtun0 remote-host 12.34.56.78


vyatta@V2# set interfaces openvpn vtun0 shared-secret-key-file /root/secret


vyatta@V2# commit


Xem file cấu hình

vyatta@V2# show interfaces openvpn vtun0
local-address 192.168.1.2
mode site-to-site
remote-address 192.168.1.1
remote-host 12.34.56.78
shared-secret-key-file /root/secret


Cấu hình static route cho mạng 192.168.100.0/24

vyatta@V2# set protocols static interface-route 192.168.100.0/24
next-hop-interface vtun0
vyatta@V2# commit


Site-to-Site Mode with TLS

1/ Cấu hình trên router V1

Đặt password cho tài khoản root là 123456

vyatta@V1# set system login user root
vyatta@V1# set system login user root authentication plaintext-password 123456
vyatta@V1# commit


Đăng nhập hệ thống với tài khoản root

Chuyển vào thư mục /usr/share/doc/openvpn/examples/easy-rsa/2.0/

root@V1#cd /usr/share/doc/openvpn/examples/easy-rsa/2.0/

Thi hành các lệnh sau, trả lời các câu hỏi khi được yêu cầu:

root@V1# source ./vars
root@V1# ./clean-all

root@V1# ./build-ca


sau khi thi hành lệnh trên sẽ tạo ra các tập tin ca.crt, ca.key trong thư mục /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys

root@V1# ./build-key-server server1

sau khi thi hành lệnh trên sẽ tạo ra các tập tin server1.csr server1.crt, server1.key trong thư mục /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys

root@V1# ./build-dh

sau khi thi hành lệnh trên sẽ tạo ra tập tin dh1024.pem trong thư mục /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys

root@V1# ./build-key server2

sau khi thi hành lệnh trên sẽ tạo ra các tập tin server2.csr server2.crt, server2.key trong thư mục /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys

copy các tập tin sau (ca.crt, dh1024.pem, server1.crt, server1.key) vào thư mục /root

root@V1# cp keys/ca.crt keys/dh1024.pem keys/server1.crt keys/server1.key /root/
copy các tập tin sau (ca.crt, server2.crt,server2.key) vào thư mục /root của router V2
root@V1# scp  keys/ca.crt root@87.65.43.21:/root/
root@V1# scp  keys/server2.crt root@87.65.43.21:/root/
root@V1# scp  keys/server2.key root@87.65.43.21:/root/


Tạo interface vtun0

root@V1# set interfaces openvpn vtun0
root@V1# set interfaces openvpn vtun0 local-address 192.168.1.1
root@V1# set interfaces openvpn vtun0 mode site-to-site
root@V1# set interfaces openvpn vtun0 remote-address 192.168.1.2

root@V1# set interfaces openvpn vtun0 remote-host 87.65.43.21


root@V1# set interfaces openvpn vtun0 tls


root@V1# set interfaces openvpn vtun0 tls role passive


root@V1# set interfaces openvpn vtun0 tls ca-cert-file /root/ca.crt


root@V1# set interfaces openvpn vtun0 tls cert-file /root/server1.crt


root@V1# set interfaces openvpn vtun0 tls dh-file /root/dh1024.pem


root@V1# set interfaces openvpn vtun0 tls key-file /root/server1.key


root@V1# commit

root@V1# show interfaces openvpn vtun0
local-address 192.168.1.1
mode site-to-site
remote-address 192.168.1.2
remote-host 87.65.43.21
tls {
role passive
ca-cert-file /root/ca.crt
cert-file /root/server1.crt
dh-file /root/dh1024.pem
key-file /root/server1.key
}


2/ Cấu hình trên router V2

Tạo interface vtun0

root@V2# set interfaces openvpn vtun0
root@V2# set interfaces openvpn vtun0 local-address 192.168.1.2

root@V2# set interfaces openvpn vtun0 remote-address 192.168.1.1


root@V2# set interfaces openvpn vtun0 remote-host 12.34.56.78


root@V2# set interfaces openvpn vtun0 tls

root@V2# set interfaces openvpn vtun0 tls role active
root@V2# set interfaces openvpn vtun0 tls ca-cert-file /root/ca.crt

root@V2# set interfaces openvpn vtun0 tls cert-file /root/server2.crt


root@V2# set interfaces openvpn vtun0 tls key-file /root/server2.key


root@V2# commit

vyatta@V2# show interfaces openvpn vtun0
local-address 192.168.1.2
mode site-to-site
remote-address 192.168.1.1
remote-host 12.34.56.78
tls {
role active
ca-cert-file /root/ca.crt
cert-file /root/server2.crt
key-file /root/server2.key
}


Hoàng Lâm (từ Vyatta)
 
Ý kiến phản hồi và bình luận Góp ý kiến của bạn

Các tin mới nhất :
- Giới thiệu cộng nghệ cáp đồng Copperten 10Gb/s
- Tốc độ Data Center thế hệ mới: 40Gb/s và 100Gb/s
- Tại sao chúng ta cần sử dụng cáp Amp netconnect và cách phân biệt cáp Amp chính hãng
- Kiến trúc cơ sở hạ tầng - phân tích hệ thống
- Những điều nên và không nên làm để đảm bảo an ninh cho mạng Wifi
- Giải pháp kết nối Internet tin cậy cho Doanh nghiệp
- Giới thiệu công nghệ chuyển mạch Trung tâm dữ liệu Cisco Nexus
- Giải pháp triển khai Dynamic Multipoint VPN
- Giải pháp hệ thống Wifi cho sân Golf
- Giải pháp sử dụng mã nguồn mở Vyatta thay thế Cisco và Fortinet (Phần V - OPENVPN)
Các tin liên quan :
- Giải pháp sử dụng mã nguồn mở Vyatta thay thế Cisco và Fortinet (Phần IV - Firewall)
- Giải pháp sử dụng mã nguồn mở Vyatta thay thế Cisco và Fortinet (Phần III - Các giao thức định tuyến)
- Giải pháp sử dụng mã nguồn mở Vyatta thay thế Cisco và Fortinet (Phần II – Cấu Hình Dịch Vụ Trên Vyatta)
- Ứng dụng quản lý Cisco UCS Manager - Giải pháp quản lý toàn diện cho Hệ thống Điện toán Hợp nhất của Cisco (Phần 2)
- Giải pháp sử dụng mã nguồn mở Vyatta thay thế Cisco và Fortinet (Phần I – Giới Thiệu Về Vyatta)
- Ứng dụng quản lý Cisco UCS Manager - Giải pháp quản lý toàn diện cho Hệ thống Điện toán Hợp nhất của Cisco (Phần 1)
- Giải pháp Hệ thống Điện toán Hợp nhất của Cisco
- Tìm hiểu IPV6 và hướng chuyển đổi IPV4 sang IPV6
- Giải pháp hệ thống dành cho doanh nghiệp với thiết bị mạng Fortinet (Phần 2)
- Hệ thống quản trị tòa nhà thông minh và hạ tầng mạng thông tin
Xem tiếp
Bài nhiều người đọc cùng chuyên mục
Thiết kế mạng Lan cho doanh nghiệp
 
Tìm Hiểu Về Hạ Tầng Công Nghệ Thông Tin cho Doanh Nghiệp
 
Phân tích và thiết kế mô hình mạng doanh nghiệp với thiết bị Cisco
 
Giải Pháp Đường Truyền WAN cho Doanh Nghiệp
 
Công nghệ và dịch vụ Wi-fi
 
Tổng quan về Metro Ethernet
 
NAT và PAT
 
Trang chủ | Giới thiệu | Quảng cáo | Liên hệ
Giấy phép ICP số 199/GP-TTĐT. Bộ Thông tin và Truyền thông cấp.
Cơ quan quản lý  : Công Ty TNHH Phát Triển Kỹ Thuật và Thương Mại Phan Nguyễn
Bản quyền © 2010-2011 Kenhgiaiphap.vn . Giữ toàn quyền.
Ghi rõ nguồn "Kenhgiaiphap.vn" khi phát hành lại thông tin từ website này.