当前位置:网站首页>ufw 端口转发
ufw 端口转发
2022-07-24 17:04:00 【ailx10】
ufw 端口转发和之前做的iptables端口转发几乎是一模一样的,不信你可以再复习一下「ailx10:iptables 端口转发」,ufw 是 iptables的unbuntu系列防火墙升级版,firewall 是 iptables的centos系列防火墙升级版,firewall 抛弃了iptables 那一套语法,简化了配置,ufw 依然传承iptables 语法,firewall的端口转发可以参考我的另一篇博客「ailx10:firewall 端口转发」。总的来说,端口转发非常有意思,可以绕过南北向流量监控~
第一步:配置允许端口转发
vim /etc/ufw/sysctl.conf
第二步:本地端口转发配置
*nat
:PREROUTING ACCEPT [0:0]
-A PREROUTING -p tcp --dport 8022 -j REDIRECT --to-port 22
COMMIT
第三步:启动ufw防火墙
ufw allow 22
ufw enable
service ufw start
service ufw status
第四步:验证本地端口转发
ssh [email protected] -p 8022
第五步:额外配置端口远程转发
vim /etc/default/ufw
第六步:配置端口远程转发,直接去iptables实验中复制就行
-A PREROUTING -p tcp --dport 13389 -j DNAT --to-destination 192.168.199.185:3389
# PREROUTING链:在进行路由选择前处理数据包(做目标地址转换)
# 去往跳板机机 13389 端口的流量 转发 到内网的3389端口
-A POSTROUTING -p tcp -d 192.168.199.185 --dport 3389 -j SNAT --to-source 192.168.199.247
# POSTROUTING链:在进行路由选择后处理数据包(对数据链进行源地址修改转换)
# 去往内网 3389 端口的流量 修改源IP是跳板机
第七步:查看13389端口,已经open

第八步:验证远程端口转发

网络安全任重道远,洗洗睡吧~

边栏推荐
- IP的概念,IP的分类,IP复用技术
- Matlab writes excel string and number merging
- [数组]NC143 矩阵乘法-简单
- QML coding specification
- MODIS 16 day data monthly / quarterly synthesis
- SS-Paper【1】:Fully Convolutional Networks for Semantic Segmentation
- Meeting OA project progress (II)
- Zcmu--5023: family division (C language)
- Digital transformation must have digital thinking
- 剑指 Offer 22. 链表中倒数第k个节点
猜你喜欢

Method of querying comma separated strings in a field by MySQL

Topic 6 - message queue for client communication

ArcGIS layer annotation display

Small end format and big end format (little endian & big endian)

AXI协议(3):AXI架构的握手机制和实现细节

JSP custom tag library --foreach

Comparison of array and object merging methods assign, merge, defaults, defaultsdeep in lodash
![[sequential logic circuit] - counter](/img/a5/c92e0404c6a970a62595bc7a3b68cd.gif)
[sequential logic circuit] - counter

Programming language exercises (I)

Template method mode
随机推荐
[zero basis] fully understand webgl (VIII)
Envi5.3 open GF-1 WFV data
Rare earth Developer Conference | Apache pulsar committee Liu Dezhi shares the way of cloud native technology transformation
JS, call in the for loop is asynchronously converted to synchronous execution
Meeting OA project progress (II)
Zcmu--5083: number pairs of ly (C language)
Delay and jitter in network
GDB online debugging of work notes
2022-07-21 Daily: Wu Enda wrote: how to establish projects suitable for AI career
The third edition of New Horizon College English reading and Writing Tutorial 4 graduation examination site (units 1,2,3,5,6)
别再到处乱放配置文件了!试试我司使用 7 年的这套解决方案,稳的一秕
Bring 120W goods in 15 seconds. You can also shoot such a popular video
【GNN报告】腾讯AI lab 徐挺洋:图生成模型及其在分子生成中的应用
【时序逻辑电路】——计数器
AMD锐龙7000预计9月15日上市 3D缓存版还要再等等
CANN训练营学习2022第二季 模型系列 动漫风格化和AOE ATC调优
安全的证券公司有哪些?我想在手机上买股票
709. Convert to lowercase letters
EF miscellaneous
IP的概念,IP的分类,IP复用技术