如何通过充当路由器的linux机器控制流量 [英] How to control traffic flow through a linux machine acting as router

查看:81
本文介绍了如何通过充当路由器的linux机器控制流量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友

我希望你很好,做得很好。目前我正在开发一个有趣的项目,其中包括硬件(Raspberry Pi)和移动应用程序。树莓派配置为本地DNS服务器+ DHCP服务器+路由器。它有两个网络接口,其中一个面向公共互联网。另一个是充当局域网。 Android应用程序连接到设备并列出一些内容。这些内容来自设备本身。在内容之间,我想根据内容信息插入一些互联网推荐。要做到这一点,我必须通过局域网允许互联网,但这样做会打开整个设备的互联网。我想只允许互联网访问应用程序。有什么方法可以实现这一点。如果没有,请指导我,以便创建自定义解决方案。非常感谢你。干杯。



我的尝试:



直到现在我有研究了很多并查看了DNS服务器,DHCP服务器和其他文章的手册等,但没有找到任何指针或直接的解决方案。

Hi Friends
I hope you are fine and doing great. Currently I am working on an interesting project that includes a hardware (Raspberry Pi) and a mobile application. The raspberry pi is configured as a local DNS server + DHCP server + router. It has two Network interfaces and one of them is facing the public internet. The other is acting as LAN. The android app connects to the device and list some content. These contents are coming from device itself. In between the content, I want to insert some internet recommendations based on the content information. To do so, I have to allow the internet through LAN but doing so will open up the internet to whole device. I want to allow the internet access to the application only. Is there any way this can be achieved. If not, please guide me so that a custom solution can be created. Thank you very much. Cheers.

What I have tried:

Till now I have studied a lot and looked at the manuals of DNS server, DHCP server and other articles etc. but have not found any pointers or direct solution.

推荐答案

看看 iptables tc


这篇关于如何通过充当路由器的linux机器控制流量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆