tuaninbox
10-10-2003, 02:02 AM
Thông thường khi connect từ xa vào router qua đường điện thoại để kiểm tra cấu hình, bạn phải tốn tiền điện thoại. Bài này hướng dẫn thực hiện exec callback, giúp tiết kiệm tiền điện thoại cá nhân khi cần phải kết nối từ xa đến công ty để làm việc.
Configuration:
version 12.0
service exec-callback -> bật chức năng exec callback lên
!
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname test
!
enable password cisco
!
username user1 nocallback-verify callback-dialstring xxxxxxx password 0 xxxxx -> không yêu cầu xác thực khi callback, số điện thoại là cố định không thể thay đổi khi thực hiện callback
username user2 callback-dialstring "" password 0 xxxxx -> user phải nhập vào số điện thoại để callback
!
ip subnet-zero
chat-script offhook "" "ATH1" OK
chat-script callback ABORT ERROR ABORT BUSY "" "AT" OK "ATDT \T" TIMEOUT 30 CONNECT \c -> đây là chat script được dùng để thực hiện callback
!
interface Ethernet0/0
ip address 10.0.0.1 255.0.0.0
no ip directed-broadcast
!
ip classless
!
line con 0
transport input none
line aux 0
script modem-off-hook offhook
script callback callback -> sử dụng chatscript để callback
!
login local
modem InOut
transport input all
callback forced-wait 5 -> đợi 5 giây sau khi disconnect initial call mới thực hiện callback
flowcontrol hardware
line vty 0 4
login local
!
end
Bây giờ mở hyper terminal lên để dial vào router
Không yêu cầu nhập số điện thoại:
ats0=1 -> bật autoanswer cho modem
OK
atdt xxxxxxx-> quay số tới router
CONNECT
username: user1
password: -> nhập password vào đây
Callback initiated - line is disconnected -> initial call bị disconnect
NO CARRIER
RING -> callback call được router thực hiện, và modem đang ring
CONNECT -> kết nối đã thành công
test>
Yêu cầu nhập số điện thoại để callback:
Cũng giống như ở trên nhưng sau khi authentication xong thì router sẽ yêu cầu nhập số điện thoại để call back
Username: user2
password:
Callback Dialstring: xxxxxxx
Callback initiated - line is disconnected
NO CARRIER
RING
CONNECT
Username: user2
password:
test>
Configuration:
version 12.0
service exec-callback -> bật chức năng exec callback lên
!
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname test
!
enable password cisco
!
username user1 nocallback-verify callback-dialstring xxxxxxx password 0 xxxxx -> không yêu cầu xác thực khi callback, số điện thoại là cố định không thể thay đổi khi thực hiện callback
username user2 callback-dialstring "" password 0 xxxxx -> user phải nhập vào số điện thoại để callback
!
ip subnet-zero
chat-script offhook "" "ATH1" OK
chat-script callback ABORT ERROR ABORT BUSY "" "AT" OK "ATDT \T" TIMEOUT 30 CONNECT \c -> đây là chat script được dùng để thực hiện callback
!
interface Ethernet0/0
ip address 10.0.0.1 255.0.0.0
no ip directed-broadcast
!
ip classless
!
line con 0
transport input none
line aux 0
script modem-off-hook offhook
script callback callback -> sử dụng chatscript để callback
!
login local
modem InOut
transport input all
callback forced-wait 5 -> đợi 5 giây sau khi disconnect initial call mới thực hiện callback
flowcontrol hardware
line vty 0 4
login local
!
end
Bây giờ mở hyper terminal lên để dial vào router
Không yêu cầu nhập số điện thoại:
ats0=1 -> bật autoanswer cho modem
OK
atdt xxxxxxx-> quay số tới router
CONNECT
username: user1
password: -> nhập password vào đây
Callback initiated - line is disconnected -> initial call bị disconnect
NO CARRIER
RING -> callback call được router thực hiện, và modem đang ring
CONNECT -> kết nối đã thành công
test>
Yêu cầu nhập số điện thoại để callback:
Cũng giống như ở trên nhưng sau khi authentication xong thì router sẽ yêu cầu nhập số điện thoại để call back
Username: user2
password:
Callback Dialstring: xxxxxxx
Callback initiated - line is disconnected
NO CARRIER
RING
CONNECT
Username: user2
password:
test>