---
title: "Discussion on \"软路由网关的实现\" | Hashnode"
description: "Discussion on \"软路由网关的实现\". 设备准备\n一台路由器，网关电脑，和客户机电脑。\n路由器：192.168.1.1\n网关机： 有两个网卡，分别为ens33(192.168.1.101), ens34(192.168.1.102)\n客户机，有一个网卡(192.168.1.201)。\n第一步，网关\n效果：\n客户机的流量→网关机→公网\n实现方式：\n\n开启转发\n\n编译文件/etc/sysctl.conf\n加入 net.ipv4.ip_forward=1\n然后执行sudo sysctl -p\n\n配置iptables:\n\nsudo iptab..."
url: "https://hashnode.com/posts/soft-router/6739869b46f144ba79ed48ac"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [软路由网关的实现](https://xiaohan.hashnode.dev/soft-router?utm_source=hashnode&utm_medium=feed)

设备准备 一台路由器，网关电脑，和客户机电脑。 路由器：192.168.1.1 网关机： 有两个网卡，分别为ens33(192.168.1.101), ens34(192.168.1.102) 客户机，有一个网卡(192.168.1.201)。 第一步，网关 效果： 客户机的流量→网关机→公网 实现方式： 开启转发 编译文件/etc/sysctl.conf 加入 net.ipv4.ip\_forward=1 然后执行sudo sysctl -p 配置iptables: sudo iptab...

Nov 17, 2024 · 3 min read · xiaohan.hashnode.dev  
Updated Jan 2, 2025  
Read the article

-   [#gateway](https://hashnode.com/tag/gateway)
-   [#routing](https://hashnode.com/tag/routing)
-   [#network](https://hashnode.com/tag/network)
-   [#proxy](https://hashnode.com/tag/proxy)

## Written by

[xiaohan](https://hashnode.com/@xiaohan)

@xiaohan

  
[View profile](https://hashnode.com/@xiaohan)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
