跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[程序员] iptables 配置全局代理失败,是什么问题

发表于

我有两台机器,ip 分别为 192.168.1.31 机器 A 、192.168.1.32 机器 B 。现在 A 可以连接网络,并且部署了代理服务,端口为 1234 。现在 B 也需要连接网络,使用 iptables 将 B 的全部流量转发至 A:1234,实现上网功能

sysctl -w net.ipv4.ip_forward=1

iptables -t nat -A PREROUTING -p tcp -s 192.168.1.32 -j DNAT --to-destination 192.168.1.31:1234


iptables -t nat -A POSTROUTING -p tcp -d 192.168.1.31 -j MASQUERADE

ip route add default via 192.168.1.31


上述配置完后,没有效果

从网上找了找又修改了

sysctl -w net.ipv4.ip_forward=1

iptables -t nat -N V2RAY
iptables -t nat -A V2RAY -d 192.168.0.0/16 -j RETURN
iptables -t nat -A V2RAY -p tcp -j DNAT --to-destination 192.168.1.31:1234
iptables -t nat -A PREROUTING -p tcp -j V2RAY
iptables -t nat -A OUTPUT -p tcp -j V2RAY


还是不生效

是我配置的有问题吗,还是有什么其他原因

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.