Here you should can connect with OpenVPN server thru VPN. However general web browsing will be accomplished with direct connections that bypass the VPN.
If you want to browse web thru VPN , please continue to follow the steps below.
1. Add the following directive to the server configuration file 'server.conf'
push "redirect-gateway def1"
push "dhcp-option DNS 168.95.1.1"
2. Setting NAT routing for VPN client on server
#vi /etc/openvpn/start-nat.sh
#!/bin/bash
ipt="/sbin/iptables"
# Clean the all rules
$ipt -F
$ipt -X
$ipt -t nat -F
$ipt -t nat -X
# Enable ip_forward
echo "1" > /proc/sys/net/ipv4/ip_forward
# For NAT routing
$ipt -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
$ipt -t nat -L
#cd /etc/openvpn
#./start-nat.sh
2010年10月4日 星期一
2010年10月1日 星期五
OPENVPN Client issue for Windows
在建立connection時,出現
NOTE: could not get adapter index for \DEVICE\TCPIP_{9A17EDDE-8CCC-474E-ABE6-8DBE7DAB42CB}, status=55 : 指定的網路資源或裝置無法再使用。
原來是因為安裝Commview的關係,只要將TAP-Win32 Adapter中的 Commview相關元件 uncheck即可.
NOTE: could not get adapter index for \DEVICE\TCPIP_{9A17EDDE-8CCC-474E-ABE6-8DBE7DAB42CB}, status=55 : 指定的網路資源或裝置無法再使用。
原來是因為安裝Commview的關係,只要將TAP-Win32 Adapter中的 Commview相關元件 uncheck即可.
2010年9月27日 星期一
Gmail IMAP, SMTP, POP3 設定值
IMAP
- imap.gmail.com
- Port: 993
- Use SSL: Yes
- smtp.gmail.com
- Port for TLS/STARTTLS: 587
- Port for SSL: 465
- pop.gmail.com
- Port: 995
- Use SSL: Yes
Meld : Diff and merge tool.
Meld is a visual diff and merge tool. You can compare two or three files and edit them in place (diffs update dynamically). You can compare two or three folders and launch file comparisons. You can browse and view a working copy from popular version control systems such such as CVS, Subversion, Bazaar-ng and Mercurial. Look at the screenshots page for more detailed features.
Token-pasting operator(##) in C
我們都知道C語言define前端處理假指令用來定義變數、字串或幾行的原始碼(統稱為巨集, Macro)。
當某一巨集被定義為參數帶入之巨集, 我們最常用的就是把該參數當作變數或指標來使用,如下所示:
然而,我們可以把巨集所帶入的參數當作為識別子(Token)的一部分,如下所示:
如上列所示,class_num可以經由GET_MEMBER巨集(帶入部份識別子, 也就是num)取得,此參數傳遞方法稱為Token-pasting operator,這是一個非常好用的方法, 提供給大家參考。
繼上次提到Token-pasting operator (##) in C文章後, 這次講一下在C語言define巨集參數使用的另一種方法, 在參數名稱前加一個#運算子, 此運算子代表所帶入的參數會被編譯器視為"字串", 所以#運算子又被稱為字串化運算子, 底下為一簡單的例子:
#define GET_RESULT(exp) printf(#exp "=%d\n", exp)
int main(void)
{
GET_RESULT(3+2);
return ;
}
當某一巨集被定義為參數帶入之巨集, 我們最常用的就是把該參數當作變數或指標來使用,如下所示:
#define INC_IDX(val, size) (++val % size) -> 以參數為變數之值帶入此巨集
#define GET_DATA(ptr) (ptr->data) -> 以參數為指標帶入此巨集
然而,我們可以把巨集所帶入的參數當作為識別子(Token)的一部分,如下所示:
#include
int class_num = 9;
int class_stds = 10;
#define GET_MEMBER(postfix) class_ ## postfix
int main(void)
{
printf("class_num: %d\n", GET_MEMBER(num));
printf("class_stds: %d\n", GET_MEMBER(stds));
return 0;
}
如上列所示,class_num可以經由GET_MEMBER巨集(帶入部份識別子, 也就是num)取得,此參數傳遞方法稱為Token-pasting operator,這是一個非常好用的方法, 提供給大家參考。
The Stringify Operator (#) in C
#define GET_RESULT(exp) printf(#exp "=%d\n", exp)
int main(void)
{
GET_RESULT(3+2);
return ;
}
2010年9月9日 星期四
IGMP Proxy
把 Linux 當 NAT 或 Router 用, 而且需要用 Multicast 時, 需裝 igmpproxy
/etc/igmpproxy.conf 設定很簡單, 只要三行就可以運作
quickleave (將 Client 送的 leave 封包轉送給 upstream)
phyint eth0 upstream (指定 upstream 的 interface)
phyint eth1 downstream (指定 downstream 的 interface)
若有額外的 Multicast Source Address, 再用 altnet 參數指定, 寫在 upstream 那行的下面.
igmpproxy 執行後, 會將 net.ipv4.conf.all.mc_forwarding 及 net.ipv4.conf.ethx.mc_forwarding 設為 1
/etc/igmpproxy.conf 設定很簡單, 只要三行就可以運作
quickleave (將 Client 送的 leave 封包轉送給 upstream)
phyint eth0 upstream (指定 upstream 的 interface)
phyint eth1 downstream (指定 downstream 的 interface)
若有額外的 Multicast Source Address, 再用 altnet 參數指定, 寫在 upstream 那行的下面.
igmpproxy 執行後, 會將 net.ipv4.conf.all.mc_forwarding 及 net.ipv4.conf.ethx.mc_forwarding 設為 1
訂閱:
文章 (Atom)
How to repair and clone disk with ddrescue
ddrescue is a tool that can be used to repair and clone disks on a Linux system . This includes hard drives, partitions, DVD discs, flas...
-
From: http://blog.chinaaet.com/justlxy/p/5100064818 SMI:串行管理接口(Serial Management Interface),通常直接被稱為MDIO接口(Management Data Input/Output I...
-
from: https://www.wpgdadatong.com/tw/blog/detail?BID=B0594 一. PHY包含的各個子層 : PCS:編碼和解碼 PMA:串行器和反序列化器 PMD:取決於物理介質 Firgure 1: OSI模型裡示意...
-
一、Dokan Library 如果您想在Windows系統上創建一個新的文件系統的話,例如:改進FAT或NTFS文件系統,您就需要自己開發一個文件系統驅動。 在Windows系統上開發工作在內核模式的設備驅動程序是一件極為困難的事情。 使用Dokan庫(Dokan L...