歡迎您光臨本站 註冊首頁

關於TUN和TAP實現橋接和路由的疑惑

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

關於TUN和TAP實現橋接和路由的疑惑

1.TAP是作橋接的,TUN是做路由的。在OpenVPN的書上是這麼說的,而且不少其他文章也認同,這個說法是否正確?
2.如果第一個說法正確,那麼在http://openvpn.net/faq.html上有如下一段話,與我寫的第一點是衝突的。哪位高人能澄清一下
When you are bridging, you must always use --dev tap on both ends of the connection. If you are routing you can use either --dev tap or --dev tun, but you must use the same on both ends of the connection. --dev tun tends to be slightly more efficient for the routing case.

3.如果按照第一點,而Windows下又只能生成TAP介面,所以Windows下無法建立路由的OpenVPN連接。這個判斷是否正確?
4.在Windows只能生成TAP介面的情況下,配置文件中如果使用dev tun,會是什麼效果?
《解決方案》

好像明白了,還是在那個FAQ里:

OpenVPN allocates one /30 subnet per client in order to provide compatibility with Windows clients due to the limitation of the TAP-Win32 driver's TUN emulation mode.
《解決方案》

呵呵,理解就好,就是這個意思
《解決方案》

回復 #3 wenzk 的帖子

版主能否針對四個問題分別給一個確切的答案,謝謝
《解決方案》

問題2的英文部分回答了問題1
2樓回復了問題3 問題4
《解決方案》

最重要是你要理解
《解決方案》

還是沒理解! 請明示!

3.如果按照第一點,而Windows下又只能生成TAP介面,所以Windows下無法建立路由的OpenVPN連接。這個判斷是否正確?
Windows下客戶端到底能不能使用tun?

4.在Windows只能生成TAP介面的情況下,配置文件中如果使用dev tun,會是什麼效果?

win客戶端使用tun , 出現如下錯誤:
Options error: On Windows, --ifconfig is required when --dev tun is used
Use --help for more information.
《解決方案》

我的windows  客戶端就是用tun模式,沒任何問題啊

# Specify that we are a client and that we
# will be pulling certain config file directives
# from the server.
client

# Use the same setting as you are using on
# the server.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel
# if you have more than one.  On XP SP2,
# you may need to disable the firewall
# for the TAP adapter.
;dev-node MyTap

[火星人 ] 關於TUN和TAP實現橋接和路由的疑惑已經有1296次圍觀

http://coctec.com/docs/service/show-post-18277.html