顯示具有 gateway 標籤的文章。 顯示所有文章
顯示具有 gateway 標籤的文章。 顯示所有文章

2015年12月2日 星期三

iptables

iptables 需要將ppp設為MASQUERADE偽裝IP才有辦法連到internet,但是這樣做會造成inner ip顯示全部變為gateway ip。修正方法為改用SNAT加指定EXTIP,但是就變成要有固定IP才可以使用。

出現錯誤訊息

Options error: server and client cannot be used together

代表conf檔案內有用到不是server指令的指令

iptables restart in ubuntu

sudo service ufw stop
sudo service ufw start

刪除單一chain下的規則
iptables -t nat -D POSTROUTING <number>

enable forwarding in ubuntu
echo 1 >/proc/sys/net/ipv4/ip_forward

如果要兩個網路能夠成功的達成路由﹐對方網路也必須有相應的路由設定指向本地網路才行

pfsense 內 openvpn檔案存放位置/var/etc/openvpn

traceroute
mac: traceroute
dos: tracert
linux: tracepath

terminate openvpn
sudo killall openvpn
參考資料
http://acman.bluenest.net/wordpress/archives/118
http://askubuntu.com/questions/298419/how-to-disconnect-from-openvpn
iptables
http://serverfault.com/questions/431593/iptables-forwarding-between-two-interface
http://askubuntu.com/questions/161551/how-to-start-stop-iptables
http://stackoverflow.com/questions/8239047/iptables-how-to-delete-postrouting-rule
http://s2.naes.tn.edu.tw/~kv/iptables.htm
https://gigenchang.wordpress.com/2014/04/19/10%E5%88%86%E9%90%98%E5%AD%B8%E6%9C%83iptables/
http://www.pcnet.idv.tw/pcnet/network/network_ip_routing.htm
pfsense存放位置
https://forum.pfsense.org/index.php?topic=13123.0
openvpn with two interface in and out
https://forums.openvpn.net/topic11033.html
https://forums.openvpn.net/topic14072.html
http://ubuntuforums.org/showthread.php?t=1606136
route
http://yinung2.blogspot.tw/2013/05/route_17.html
bridge vs routing
https://community.openvpn.net/openvpn/wiki/BridgingAndRouting
https://openvpn.net/index.php/open-source/documentation/miscellaneous/76-ethernet-bridging.html
chain using openvpn
http://serverfault.com/questions/512160/vpn-chaining-using-openvpn
dns server on openvpn
http://superuser.com/questions/637579/setting-dns-servers-using-openvpn-client-config-file
show route on mac
http://stackoverflow.com/questions/6782658/how-to-get-default-gateway-in-mac-osx
自己

2013年12月9日 星期一

pfsense pptp 807

本來以為807是port filtered造成的,結果發現是一場誤會。(修正:filtered會造成807沒錯,但是是要從內網去test port,如果從外網IP去test會有filtered卻連得上的結果,可能跟中華電信有關)

我出現807時pfsense都會出現這行字 vnode_pager_getpages i/o read error,然後web gui會出現這段並且無法登入,也許出現的字會略不同:
Warning: fopen(/tmp/config.lock): failed to open stream: Device not configured in /etc/inc/util.inc on line 127 Warning: flock() expects parameter 1 to be resource, null given in /etc/inc/util.inc on line 138 Warning: fclose() expects parameter 1 to be resource, null given in /etc/inc/util.inc on line 139 Warning: session_start(): open(/var/tmp//sess_c117ccb8d15b44abd4d463ae8ce44d7c, O_RDWR) failed: No space left on device (28) in /etc/inc/auth.inc on line 1357
搜尋的結果並不是pfsense的問題,我之前還寫了個小程式讓pfsense重啟,短期是有效但是會造成使用中一直中斷也不行,有人說把virtualbox的設定值存放裝置內使用主機I/O快取關閉,這樣可以改用virtualbox內的cache,不過測試結果還是一樣會出現錯誤,可能我硬碟真的loading太大。最後參考了一篇提到,把虛擬硬碟檔案放到與系統碟不同的硬碟存放就可以避免,試了之後也的確有效。注意此處的系統碟不是指WINDOWS安裝的磁區,而是另一顆實體硬碟上的磁區。

另外如果要使用PPPOE則不要在general setup設定DNS server,並且要把之前使用的gateway清除,否則會無法獲取IP。

如果無法獲取IP時便重啟之參考code
ping -n 1 xxx.yyy.zzz.www | findstr TTL && start home.mp3
ping -n 1 xxx.yyy.zzz.www | findstr TTL || start alarm.mp3

參考資料
http://www.vixual.net/blog/archives/32
http://forum.pfsense.org/index.php?topic=39390.0
http://www.techsupportforum.com/forums/f31/windows-7-pptp-vpn-error-807-and-800-a-559778.html
http://answers.microsoft.com/en-us/windows/forum/windows_7-networking/windows-7-pro-pptp-vpn-error-807-and-will-not/6cb8e5a3-a107-4164-bc2b-131a5fc12ba6
http://zh.wikipedia.org/wiki/%E9%BB%9E%E5%B0%8D%E9%BB%9E%E9%9A%A7%E9%81%93%E5%8D%94%E8%AD%B0
http://blog.xuite.net/gp.gp/os/26008367
http://forum.pfsense.org/index.php?topic=57459.0
http://forum.pfsense.org/index.php?topic=53469.5;wap2
http://serverfault.com/questions/396666/batch-ping-ip-and-execute-different-commands-on-return