当前位置: 首页 > news >正文

eMule firewall config - iptables forward rules

To publicize tcp://10.8.0.2:24662 and udp://10.8.0.2:24672 from your OpenVPN client running eMule, you can use port forwarding through iptables to map those ports on the VPS’s WAN interface (enp1s0) to the OpenVPN client’s IP (10.8.0.2). Here’s how to set it up:

  1. Forward TCP Port 24662:

    Run this command to forward TCP traffic on enp1s0 (VPS WAN interface) at port 24662 to the OpenVPN client (10.8.0.2):

    sudo iptables -t nat -A PREROUTING -i enp1s0 -p tcp --dport 24662 -j DNAT --to-destination 10.8.0.2:24662
    
  2. Forward UDP Port 24672:

    Run this command to forward UDP traffic on enp1s0 at port 24672 to the OpenVPN client (10.8.0.2):

    sudo iptables -t nat -A PREROUTING -i enp1s0 -p udp --dport 24672 -j DNAT --to-destination 10.8.0.2:24672
    
  3. Enable IP Forwarding:

    Ensure that IP forwarding is enabled on your VPS by checking the /proc/sys/net/ipv4/ip_forward value:

    sudo sysctl -w net.ipv4.ip_forward=1
    

    To make this permanent, add or update the following line in /etc/sysctl.conf:

    net.ipv4.ip_forward = 1
    
  4. Configure MASQUERADE for Outbound Traffic:

    Add a MASQUERADE rule to handle the outbound traffic from the OpenVPN network:

    sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o enp1s0 -j MASQUERADE
    

These steps will forward external requests on ports 24662 (TCP) and 24672 (UDP) to your OpenVPN client (10.8.0.2), making the eMule service accessible publicly via x.x.x.x:24662 (TCP) and x.x.x.x:24672 (UDP).

To verify, you can check the iptables rules:

sudo iptables -t nat -L -v -n

iptables
You can remove uncessary iptables rules: Remove a rule from iptables

Test connection

eMule test port connection

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 【Kubernetes】常见面试题汇总(十二)
  • 使用Ubuntu耳机输出正弦波信号
  • 首次在rasa中使用form的个人小结
  • stm32 W25Q数据存储
  • C语言的结构体类型
  • Rust Windows下编译 静态链接VCRuntime140.dll
  • 华为 HCIP 认证费用和报名资格
  • 【5G QoS】详解5G QoS端到端工作机制
  • Linux tr命令
  • CMake构建学习笔记16-使用VS进行CMake项目的开发
  • [论文笔记]ChatQA: Surpassing GPT-4 on Conversational QA and RAG
  • 【LLM多模态】文生视频评测基准VBench
  • django-admin自定义功能按钮样式
  • 数据结构之栈和队列的应用
  • 【物联网技术大作业】设计一个智能家居的应用场景
  • [ 一起学React系列 -- 8 ] React中的文件上传
  • Docker 1.12实践:Docker Service、Stack与分布式应用捆绑包
  • ES6系统学习----从Apollo Client看解构赋值
  • Intervention/image 图片处理扩展包的安装和使用
  • vue从入门到进阶:计算属性computed与侦听器watch(三)
  • webpack项目中使用grunt监听文件变动自动打包编译
  • 百度地图API标注+时间轴组件
  • 从0搭建SpringBoot的HelloWorld -- Java版本
  • 第十八天-企业应用架构模式-基本模式
  • 记录一下第一次使用npm
  • 利用jquery编写加法运算验证码
  • 模仿 Go Sort 排序接口实现的自定义排序
  • 微信小程序设置上一页数据
  • 想使用 MongoDB ,你应该了解这8个方面!
  • 3月27日云栖精选夜读 | 从 “城市大脑”实践,瞭望未来城市源起 ...
  • Play Store发现SimBad恶意软件,1.5亿Android用户成受害者 ...
  • ‌分布式计算技术与复杂算法优化:‌现代数据处理的基石
  • # Python csv、xlsx、json、二进制(MP3) 文件读写基本使用
  • # Redis 入门到精通(八)-- 服务器配置-redis.conf配置与高级数据类型
  • #大学#套接字
  • #经典论文 异质山坡的物理模型 2 有效导水率
  • (2)STL算法之元素计数
  • (3)llvm ir转换过程
  • (c语言)strcpy函数用法
  • (void) (_x == _y)的作用
  • (二十四)Flask之flask-session组件
  • (六)激光线扫描-三维重建
  • (每日一问)操作系统:常见的 Linux 指令详解
  • (四)Tiki-taka算法(TTA)求解无人机三维路径规划研究(MATLAB)
  • (轉)JSON.stringify 语法实例讲解
  • **登录+JWT+异常处理+拦截器+ThreadLocal-开发思想与代码实现**
  • *上位机的定义
  • . Flume面试题
  • .net 无限分类
  • .NetCore Flurl.Http 升级到4.0后 https 无法建立SSL连接
  • 。Net下Windows服务程序开发疑惑
  • ?php echo $logosrc[0];?,如何在一行中显示logo和标题?
  • @Transactional 竟也能解决分布式事务?
  • [ A*实现 ] C++,矩阵地图
  • [ C++ ] STL_vector -- 迭代器失效问题