課程
/運(yùn)維&測試
/Linux
/用iptables搭建一套強(qiáng)大的安全防護(hù)盾
麻煩講下iptables的端口映射,謝謝
2015-06-07
源自:用iptables搭建一套強(qiáng)大的安全防護(hù)盾 3-1
正在回答
課程講的不是很理解,只能引用了 一個(gè)網(wǎng)上博客的方法,希望對你有幫助
其中網(wǎng)關(guān)及其配置雙網(wǎng)卡
eth0:192.168.0.11
eth1:202.106.76.231
其他內(nèi)網(wǎng)機(jī)器設(shè)置網(wǎng)關(guān)為192.168.0.11
echo 1 >/proc/sys/net/ipv4/ip_forward/sbin/modprobe ip_tables/sbin/modprobe ip_conntrack/sbin/modprobe ip_conntrack_ftp/sbin/modprobe ip_nat_ftpiptables -t nat -Fiptables -F INPUTiptables -F OUTPUTiptables -F FORWARDiptables -t nat -A POSTROUTING -s 0/0 -j MASQUERADE
#接下來就可以設(shè)置映射端口了
#如下面把把:192.168.0.10:80 映射出去
iptables -t nat -A PREROUTING -d 202.106.76.231 -p tcp --dport 80 -j DNAT --to 192.168.0.10:80iptables -t nat -A POSTROUTING -d 192.168.0.10 -p tcp --dport 80 -j SNAT --to 192.168.0.11:80
查看
iptables -t nat -L -n
清除剛才設(shè)置的
iptables -t nat -F
舉報(bào)
如何用iptables守護(hù)好您家的前門和后院,這門課程有你想要的
1 回答iptables
1 回答iptables 報(bào)錯(cuò)
2 回答iptables 和 firewall 有些什么區(qū)別
2 回答關(guān)于命令iptables -I INPUT -i lo -j ACCEPT
2 回答iptables設(shè)置后為啥本機(jī)不能訪問本機(jī)
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2015-12-25
課程講的不是很理解,只能引用了 一個(gè)網(wǎng)上博客的方法,希望對你有幫助
其中網(wǎng)關(guān)及其配置雙網(wǎng)卡
eth0:192.168.0.11
eth1:202.106.76.231
其他內(nèi)網(wǎng)機(jī)器設(shè)置網(wǎng)關(guān)為192.168.0.11
echo 1 >/proc/sys/net/ipv4/ip_forward
/sbin/modprobe ip_tables
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_nat_ftp
iptables -t nat -F
iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD
iptables -t nat -A POSTROUTING -s 0/0 -j MASQUERADE
#接下來就可以設(shè)置映射端口了
#如下面把把:192.168.0.10:80 映射出去
iptables -t nat -A PREROUTING -d 202.106.76.231 -p tcp --dport 80 -j DNAT --to 192.168.0.10:80
iptables -t nat -A POSTROUTING -d 192.168.0.10 -p tcp --dport 80 -j SNAT --to 192.168.0.11:80
查看
iptables -t nat -L -n
清除剛才設(shè)置的
iptables -t nat -F