You are here

解決開NAT之後部份網站/服務無法連上的問題

一般NAT的設定方式如下

echo "1" > /proc/sys/net/ipv4/ip_forward
modprobe ip_tables
modprobe ip_nat_ftp
modprobe ip_nat_irc
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_conntrack_irc
iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.1.0/24 -j MASQUERADE

但在Ubuntu或是Debain上架設時, 有時會發現透過NAT之後部份網站沒辦法連上去的問題, 例如 www.microsoft.com,www.hotmail.com , MSN ..等等,
試著執行下面命令試試吧

iptables -A FORWARD -o ppp0 -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1400:1536 -j TCPMSS --clamp-mss-to-pmtu

當你發現執行以下命令出現錯誤時

iptables -A FORWARD -o ppp0 -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1400:1536 -j TCPMSS --clamp-mss-to-pmtu
iptables: No chain/target/match by that name

請先檢查核心的TCPMSS的模組是否有被編進去

以kernel 2.6.22 為例, 如下位置

Networking  --->

Networking options  --->

Network packet filtering framework (Netfilter)  --->

Core Netfilter Configuration  ---> "TCPMSS" target support

參考資料 : http://moto.debian.org.tw/viewtopic.php?t=10205

Tags: 

Comments

You're the one with the barnis here. I'm watching for your posts.

anhxYG gixismvkupju

prednisone 728 viagra 135

Add new comment

Full HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.