OpenVPN搭建中tap与tun的实际使用区别

tap俗称网桥模式,tun俗称路由模式,tap在二层,tun在三层,在实际应用中,其实以上这些知识概念,我是抄来的,具体的解释可以看以下参考链接。

下面将介绍在实际使用中的区别:

1、tap可以直接使用route这样的路由表命令,但不能用于手机设备。

2、tun可以用于手机,但不能使用route这样的路由表命令,压根无法穿透。

所以,如果想要组件VPN实现路由命令进行路由网关的多级跳转,那么需要搭建tap网桥模式。

如果使用了tun模式,那么悲剧的东西要来了,想要实现nat转发,那么你只能选择使用iptables来实现。

参考:

https://www.hostloc.com/thread-6508-1-1.html

http://blog.shell909090.org/blog/archives/2724/

https://my.oschina.net/guol/blog/39924

https://blog.csdn.net/wsclinux/article/details/53289197

https://community.openvpn.net/openvpn/wiki/BridgingAndRouting(官方介绍)

https://community.openvpn.net/openvpn/wiki/BridgingOverview(官方介绍)

https://openvpn.net/index.php/open-source/faq/75-general/311-what-are-the-fundamental-differences-between-bridging-and-routing-in-terms-of-configuration.html(官方介绍)

猜你喜欢

转载自www.cnblogs.com/EasonJim/p/9657039.html
今日推荐