此×××能很好的封裝數據,使一些網絡層的數據能在其他的網絡協議中傳輸。
但是此×××有一個缺點便是沒有好的加密機制。
配置方法:
拓撲:PC - RA - RB - PC
ROUTER - A
Interface s0/1
ip add 192.168.1.1 255.255.255.0
no shutdown
Interface Tunnel0
ip add 1.1.1.1 255.255.255.0
no shutdown
tunnel source s0/1
tunnel destination 192.168.1.2
tunnel key 123 此密碼可不設置
ROUTER - B
Interface s0/2
ip add 192.168.1.2 255.255.255.0
no shutdown
Interface Tunnel0
ip add 1.1.1.2 255.255.255.0
no shutdown
tunnel source s0/2
tunnel destination 192.168.1.1
tunnel key 123
因爲數據默認不會從Tunnel隧道走,所以要在兩個路由器分別添加一條默認路由。
ip route 0.0.0.0 0.0.0.0 tunnel 0
使用PC PING PC即可通信。
如需查看數據是否從隧道通過,在路由器特權模式下:
debug tunnel event
使用路由器內網地址PING對端任意地址即可看到Tunnel口發送和接收的數據。