偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

Ubuntu 10.10 設(shè)置iptables做NAT

系統(tǒng) Linux
iptables 是與最新的 2.6.x 版本Linux 內(nèi)核集成的 IP 信息包過(guò)濾系統(tǒng)。本文為大家介紹下Ubuntu 10.10 設(shè)置iptables做NAT的具體過(guò)程。

我們?cè)谟?strong>Ubuntu下的iptables時(shí),要想做NAT,就教給大家方法:

  eth0連接ADSL Modem,設(shè)成DHCP,同時(shí)要讓ADSL自動(dòng)啟動(dòng),所以eth0就不要自動(dòng)啟動(dòng)了。eth1做內(nèi)網(wǎng)連接網(wǎng)卡,IP地址是192.168.3.1,將網(wǎng)關(guān)設(shè)成0.0.0.0,DNS不要設(shè)置。因?yàn)锳DSL撥號(hào)成功之后,會(huì)自動(dòng)獲取網(wǎng)關(guān)和DNS的設(shè)置,所以eth1不能設(shè)置網(wǎng)關(guān)和DNS。

  設(shè)置iptables,如下:

 

  1.   # Generated by iptables-save v1.4.4 on Wed Nov 3 22:07:11 2010  
  2.  

 

  *nat

  :PREROUTING ACCEPT [89:5389]

  :OUTPUT ACCEPT [99:6218]

  :POSTROUTING ACCEPT [99:6218]

  -A POSTROUTING -s 192.168.3.0/24 -o ppp0 -j MASQUERADE

  COMMIT

 

  1.   # Completed on Wed Nov 3 22:07:11 2010  
  2.  
  3.   # Generated by iptables-save v1.4.4 on Wed Nov 3 22:07:11 2010  
  4.  

 

  *filter

  :INPUT ACCEPT [2965:1911992]

  :FORWARD ACCEPT [614:192167]

  :OUTPUT ACCEPT [5625:1000183]

  -A INPUT -i lo -j ACCEPT

  -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT

  -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT

  -A INPUT -m state --state ESTABLISHED -j ACCEPT

  -A INPUT -i ppp0 -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j DROP

  -A OUTPUT -o lo -j ACCEPT

  -A OUTPUT -p tcp -m tcp --sport 22 -j ACCEPT

  -A OUTPUT -p tcp -m tcp --sport 443 -j ACCEPT

  COMMIT

 

  1.   # Completed on Wed Nov 3 22:07:11 2010  
  2.  

 

  以上設(shè)置開(kāi)通了ssh和https兩項(xiàng)服務(wù),其他來(lái)自ppp0的連接都將被drop。

  以上設(shè)置是輸入了iptables命令之后,使用iptables-save生成的,保存以上內(nèi)容為:/etc/iptables-config,然后修改/etc/rc.local,加入:

 

  1.   echo "1" > /proc/sys/net/ipv4/ip_forward  
  2.  
  3.   iptables-restore < /etc/iptables-config  

通過(guò)文章的描述和代碼的分析,我們知道Ubuntu 10.10 設(shè)置iptables做NAT的具體過(guò)程。希望本文對(duì)大家有幫助!

【編輯推薦】

  1. iptables與natcheck
  2. iptables限制訪問(wèn)某個(gè)IP地址
  3. 用iptables限制黑客破解密碼
  4. iptables 菜鳥(niǎo)變大蝦
  5. iptables 端口轉(zhuǎn)發(fā)
  6. iptables nat 技術(shù)筆記

 

責(zé)任編輯:趙鵬 來(lái)源: 網(wǎng)絡(luò)轉(zhuǎn)載
相關(guān)推薦

2011-01-12 09:59:28

Ubuntu Serviptables

2011-03-15 16:26:46

iptablesnat

2011-09-02 15:31:00

ubuntu路由器路由

2011-03-21 10:13:22

Ubuntu自動(dòng)播放

2011-03-16 09:05:34

iptablesnat

2011-03-17 14:09:03

iptables na

2011-03-16 10:59:57

2011-03-17 13:02:07

iptables na

2011-03-15 14:26:23

iptablesNAT

2011-03-15 09:10:47

iptablesNAT

2011-01-10 10:40:19

Ubuntu

2010-08-27 09:09:15

Ubuntu 10.1

2010-07-27 13:56:55

Ubuntu TweaUbuntu 10.1

2010-07-16 13:52:30

Ubuntu 10.1

2011-09-07 13:33:51

ubuntuUbuntu Twea

2011-03-16 09:05:29

iptablesNAT

2011-03-17 13:55:23

iptablesNAT端口映射

2011-03-16 09:05:32

RedhatiptablesNAT

2011-08-29 11:16:27

Ubuntu

2011-09-05 18:11:39

Ubuntu
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)