2008-05-13

Linux 多個ADSL 合併方式

配置多個ADSL 

運行adsl-setup程序,會一步一步的提示你完成配置過程.

創建ppp0

(1)直接拷貝
cp /etc/sysconfig/network-scripts/ifcfg-ppp0 /etc/sysconfig/network-scripts/ifcfg-ppp1

(2)修改其中的ppp0為ppp1,

修改PIDFILE=/var/run/pppoe-adsl.pid 為PIDFILE=/var/run/pppoe-adsl1.pid
修改採用的新接線路的網卡,例如:改ETH=eth1 為ETH=eth2


(3)增加新線路的帳號和密碼. 帳號密碼一般是保存在/etc/ppp/chap-secrets 和pap-secrets

我們只需要在最後增加新的用戶名2和密碼2即可.


啟動多個ppp

因為adsl-start 命令缺省只能啟動第一的ppp接口。所以要啟動兩個接口,必須指定配置文件。

可以用:
方法一:
ifup ppp0
ifup ppp1
(ifup pppn...)

或方法二:

adsl-start /etc/sysconfig/network-scripts/ifcfg-ppp0
adsl-start /etc/sysconfig/network-scripts/ifcfg-ppp1
(adsl-start /etc/sysconfig/network-scripts/ifcfg-pppn)

在 /etc/rc.local 後面增加:

ifup ppp0

ifup ppp1

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -A POSTROUTING -t nat -s 192.168.1.0/24 -o ppp0 -j MASQUERADE

iptables -A POSTROUTING -t nat -s 192.168.1.0/24 -o ppp1 -j MASQUERADE

ip route replace default scope global nexthop dev ppp0 weight 1 nexthop dev ppp1 weight 1

ip route flush cache





參考連結:寂雨(&$^#@*!~)|在Linux下配置多線路ADSL的方法


另一個方法:【轉】雙adsl鏈路冗餘互備及流量分擔的實現

Linux 的 BONDING 可以用來合併頻寬

Linux 的 BONDING 可以用來合併頻寬
參考連結:|聯成電子報 第十一期 2006年07月|講師專欄 Linux

2008-05-12

擴充 yum 的內含

擴充 yum 的內含
yum內含套件只有基本必要套件而已 (如. proftpd...就不在yum中),所以我們可以透過設定 [RPMforge] 來增加套件數量。
執行安裝 [RPMforge] 套件
#rpm -Uhv
http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm




參考連結:Weithenn Study Daily: CentOS 5.1-初始環境設定:

iptables -L -vn

iptables -L -vn
"-L" 參數列出鏈中的規則, 因為沒有指定鏈名, 所以預設列出 filter 鏈的規則
"-v" 參數將顯示完整的資訊, 以便觀察傳輸量統計的狀況, 一般不使用"-v "參數時, 只會顯示如來源位址等簡要的資訊
"-n" 參數設定 iptables 不要將 IP 反查為網域名稱



原始連結:旗標知識網:如何使用 iptables 統計傳輸量

knownhost 的 vps 如何使用 port 轉向

將 port:8080 轉到 port:10000
在knownhost 的vps 測試多次,底下的用法才能使用
iptables -t nat -A PREROUTING -p tcp -i venet0 --dport 8080 -j DNAT --to-destination 67.222.10.12(實體ip):10000
以下用法,是失敗的
iptables -t nat -A PREROUTING -p tcp -i venet0 --dport 8080 -j DNAT --to-destination 0.0.0.0:10000
iptables -t nat -A PREROUTING -p tcp -i venet0 --dport 8080 -j DNAT --to-destination 127.0.0.1:10000



參考連結:IPTABLES: DNAT port 1433 - LinuxQuestions.org

vps的iptable如何使用venet0:0

在 linux 的 venet0:0 是模擬出來的。

if venet0:0 is 192.168.1.1
change:
/sbin/iptables -A OUTPUT -o venet0:0 -m state --state NEW -j ACCEPT
to:
/sbin/iptables -A OUTPUT -o venet0 -s 192.168.1.1 -m state --state NEW -j ACCEPT


原文連結:Iptables error: weird character in interface `venet0:0' - VPSlink Forums

2008-05-09

如何在godaddy的name server 中使用自已的ip

主要在 host Summary 加入 ip ,然後在 Name Servers 中 加入 Summary 中的 domain ,就可以了

原文:
You are not required to register hosts, but if you intend to set up your own Domain Name Server (DNS) service, you can register your own hosts.
WARNING: Unless you have a thorough understanding of this process, we recommend that you do not use this feature.
To Register Your Own Hosts
Log in to your Account Manager.
In the My Products section, click Manage Domains.
Click the domain for which you want to create a host.
In the Host Summary area at the bottom of the page, click the add hyperlink in the header.
In the Host Name field, enter the host name you want to register.
NOTE: Do not enter "www" as your host name.
In the Host IP fields, enter the IP address(es) you want to add to the host.
Click OK.
It takes 4 to 8 hours to register hosts for .COM and .NET domains and 24 to 48 hours for all other domain extensions.

原文連結 >>Registering Your Own Nameservers - Help Center—Knowledge Base and FAQ