關於24耐… 我想說的是

13年前的今天考到機車駕照, 那天早上拿到駕照下午就跟大學同學出遊…去哪是忘了, 但那天是七夕情人節XD

的確13年本身是沒啥了不起, 剛好近日新聞又有不要命的恍神騎士……

這其實是在我們這個年代就有的暑期傳說, 24耐, 意即24小時環島一周, 這個如果是指開車, 本身就不是很正常的行為….(但開車24耐難度真的很低)

更何況是騎機車…不過那真的不只是傳說…

閱讀全文〈關於24耐… 我想說的是〉

北歐探險隊(2017) – Prologue

Pre-Preface

拖拖拉拉到現在都快過去一年, 這場超過一萬公里長征, 除了各式照片&一點點紀念品,例如: 老婆不知道為什麼買了的一堆罐頭, 說是要分送給親朋好友, 可是送罐頭給別人超奇怪, 所以目前還在廚房櫃子裡偶爾拿出來賭運氣, 因為早就忘記裡面裝的是什麼……

各種魚罐頭&義大利麵醬 小黑保溫瓶也跟我們去旅行過~ 裡面還有吃剩生的義大利麵

反正我們大概一直都會是這種種free style, 一個至少我原生家庭永遠搞不懂我們在想什麼那種style (事實上我們是真的沒想太多XDD) 閱讀全文〈北歐探險隊(2017) – Prologue〉

大建設時代的夢

這禮拜收拾書桌發現很多有趣的東西, 竹中竹女聖誕舞會入場券、入學通知、成績單啊什麼的

其中這筆我果然沒有記錯, 關於台灣公路@一個大建設時代的願景, 這現在看來就真的只能是紙上談兵了吧XD

IMAG4887

國道五號延伸現在的北宜高速公路終點:蘇澳

世人最熟悉的蘇花高, 現在已經變蘇花替興建中, 不過其實他一路會開到台東, 穿過山脈到萬巒吃豬腳(?

IMAG4895

這張可以順便看到傳說新南橫的台24, 目前終點在霧台, 也是八八風災受損嚴重的災區之一, 今天還有馬囧的相關新聞

 

IMAG4889

整張圖最困難的應該是國道六號, 圖上還只是預定線, 2015年的今天, 停在埔里,預計要接到鯉魚潭…

我是很難想像鯉魚潭變得跟碧潭一樣

但至少還有滿大的野心要衝上霧社, 不過之後的應該就只能流於想像了吧…

通車得貫通能高越嶺的山, 這條在ptt公路板有討論過, 因為該區爬升太快,也沒地方架高架路廊,

低海拔打穿隧道又會岩爆(因為山太高造成的壓力使然) 也不像雪隧, 周邊有既有的道路可以做隧道通風工程

而且真的親臨台14目前的通車終點, 能高越嶺古道西段的起點: 屯原,

你我一定都不忍心為了所謂的後山交通…毀掉這座山林

當然, 可以說西部人很自私, 但這個島真的受不起這樣的開發, 更別說後續維護有形無形的成本

對了, 圖上也可以看到台14這個預定線, 曾經是中橫候選, 建築在能高越嶺之上的公路.

不過還是留給大自然吧, 有機會滿想親自走走看的!

 

剩下的就是已知預定但最後不是沒錢就是環評不會過的路段, 說實在這些路段就算開通了,

大概也是不斷的修修補補, 成本跟使用率可能接近無限大

 

IMAG4888

離我們很近的縣道120, 預計終點是高義 (你他x雜碎), 現行終點是八五山. 通車好像只是幫水蜜桃更早下山(誤

 

IMAG4890

台16線, 翻丹大林道過七彩湖萬榮林道, 預計通到萬榮(又可以吃豬腳了), 現行通車路段是孫海橋. 是個與世獨立的世界

台16東段已解編, 這條路將永遠只是想像

 

IMAG4892

台18線,這個被稱作新中橫的公路,預定終點是玉里, 現行終點是塔塔加, 中間是傳說的八通關古道.未定的路線也都已經解編了

現在台18東段被納入台30, 玉長公路

前些日子去實地勘察過, 還是保留現在的樣子就好了吧

 

塔塔加接續的另一段是台21, 可稱為超級台三線, 因為它又比台三線, 更沿山了

這段未定我就真的不知道為何不做…

IMAG4893

塔塔加到三民這段, 現今也正式解編, 原來南段的編入台29,三民,甲仙…旗山…終點好像是林邊

 

另外值得一提的是

這圖裡的台26反倒沒有接起來, 是當時已經宣布環評不過了?

但倒是有一段謎樣的綠虛線 @@

IMAG4896

 

對照今日的事實 大概還差了海岸山脈被開了兩三條線, 這上面都不存在

看來根本就不把東部當人看 (戰

 

最後補上封面:

IMAG4897

 

印象中這張應該是小學五年級不知道為何而買, (不過台8/8甲線 畫虛線, 看起來應該是921之後…)

也是那個時候我迷上台灣公路地圖

然後我也真的走過了這條條大路,

台灣真的很美, 但公路所無法到達的, 才是瑰寶啊

[note] site to site VPN

How to create a site-to-site IPsec VPN tunnel using Openswan in Linux

A virtual private network (VPN) tunnel is used to securely interconnect two physically separate networks through a tunnel over the Internet. Tunneling is needed when the separate networks are private LAN subnets with globally non-routable private IP addresses, which are not reachable to each other via traditional routing over the Internet. For example, VPN tunnels are often deployed to connect different NATed branch office networks belonging to the same institution.

Sometimes VPN tunneling may be used simply for its security benefit as well. Service providers or private companies may design their networks in such a way that vital servers (e.g., database, VoIP, banking servers) are placed in a subnet that is accessible to trusted personnel through a VPN tunnel only. When a secure VPN tunnel is required, IPsec is often a preferred choice because an IPsec VPN tunnel is secured with multiple layers of security.

This tutorial will show how we can easily create a site-to-site VPN tunnel using Openswan in Linux.

Topology

This tutorial will focus on the following topologies for creating an IPsec tunnel.

Installing Packages and Preparing VPN Servers

Usually, you will be managing site-A only, but based on the requirements, you could be managing both site-A and site-B. We start the process by installing Openswan.

On Red Hat based Systems (CentOS, Fedora or RHEL):

# yum install openswan lsof

On Debian based Systems (Debian, Ubuntu or Linux Mint):

# apt-get install openswan

Now we disable VPN redirects, if any, in the server using these commands:

# for vpn in /proc/sys/net/ipv4/conf/*;
# do echo 0 > $vpn/accept_redirects;
# echo 0 > $vpn/send_redirects;
# done

Next, we modify the kernel parameters to allow IP forwarding and disable redirects permanently.

# vim /etc/sysctl.conf
1
2
3
net.ipv4.ip_forward = 1
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0

Reload /etc/sysctl.conf:

# sysctl -p

We allow necessary ports in the firewall. Please make sure that the rules are not conflicting with existing firewall rules.

# iptables -A INPUT -p udp –dport 500 -j ACCEPT
# iptables -A INPUT -p tcp –dport 4500 -j ACCEPT
# iptables -A INPUT -p udp –dport 4500 -j ACCEPT

Finally, we create firewall rules for NAT.

# iptables -t nat -A POSTROUTING -s site-A-private-subnet -d site-B-private-subnet -j SNAT –to site-A-Public-IP

Please make sure that the firewall rules are persistent.

Note:

  • You could use MASQUERADE instead of SNAT. Logically it should work, but it caused me to have issues with virtual private servers (VPS) in the past. So I would use SNAT if I were you.
  • If you are managing site-B as well, create similar rules in site-B server.
  • Direct routing does not need SNAT.

Preparing Configuration Files

The first configuration file that we will work with is ipsec.conf. Regardless of which server you are configuring, always consider your site as ‘left‘ and remote site as ‘right‘. The following configuration is done in siteA’s VPN server.

# vim /etc/ipsec.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
## general configuration parameters ##
config setup
        plutodebug=all
        plutostderrlog=/var/log/pluto.log
        protostack=netkey
        nat_traversal=yes
        virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/16
        ## disable opportunistic encryption in Red Hat ##
        oe=off
## disable opportunistic encryption in Debian ##
## Note: this is a separate declaration statement ##
include /etc/ipsec.d/examples/no_oe.conf
## connection definition in Red Hat ##
conn demo-connection-redhat
        authby=secret
        auto=start
        ike=3des-md5
        ## phase 1 ##
        keyexchange=ike
        ## phase 2 ##
        phase2=esp
        phase2alg=3des-md5
        compress=no
        pfs=yes
        type=tunnel
        left=<siteA-public-IP>
        leftsourceip=<siteA-public-IP>
        leftsubnet=<siteA-private-subnet>/netmask
        ## for direct routing ##
        leftsubnet=<siteA-public-IP>/32
        leftnexthop=%defaultroute
        right=<siteB-public-IP>
        rightsubnet=<siteB-private-subnet>/netmask
## connection definition in Debian ##
conn demo-connection-debian
        authby=secret
        auto=start
        ## phase 1 ##
        keyexchange=ike
        ## phase 2 ##
        esp=3des-md5
        pfs=yes
        type=tunnel
        left=<siteA-public-IP>
        leftsourceip=<siteA-public-IP>
        leftsubnet=<siteA-private-subnet>/netmask
        ## for direct routing ##
        leftsubnet=<siteA-public-IP>/32
        leftnexthop=%defaultroute
        right=<siteB-public-IP>
        rightsubnet=<siteB-private-subnet>/netmask

Authentication can be done in several different ways. This tutorial will cover the use of pre-shared key, which is added to the file /etc/ipsec.secrets.

# vim /etc/ipsec.secrets
1
2
3
siteA-public-IP  siteB-public-IP:  PSK  "pre-shared-key"
## in case of multiple sites ##
siteA-public-IP  siteC-public-IP:  PSK  "corresponding-pre-shared-key"

Starting the Service and Troubleshooting

The server should now be ready to create a site-to-site VPN tunnel. If you are managing siteB as well, please make sure that you have configured the siteB server with necessary parameters. For Red Hat based systems, please make sure that you add the service into startup using chkconfig command.

# /etc/init.d/ipsec restart

If there are no errors in both end servers, the tunnel should be up now. Taking the following into consideration, you can test the tunnel with ping command.

  1. The siteB-private subnet should not be reachable from site A, i.e., ping should not work if the tunnel is not up.
  2. After the tunnel is up, try ping to siteB-private-subnet from siteA. This should work.

Also, the routes to the destination’s private subnet should appear in the server’s routing table.

# ip route
[siteB-private-subnet] via [siteA-gateway] dev eth0 src [siteA-public-IP]
default via [siteA-gateway] dev eth0

Additionally, we can check the status of the tunnel using the following useful commands.

# service ipsec status
IPsec running  - pluto pid: 20754
pluto pid 20754
1 tunnels up
some eroutes exist
# ipsec auto –status
## output truncated ##
000 "demo-connection-debian":     myip=<siteA-public-IP>; hisip=unset;
000 "demo-connection-debian":   ike_life: 3600s; ipsec_life: 28800s; rekey_margin: 540s; rekey_fuzz: 100%; keyingtries: 0; nat_keepalive: yes
000 "demo-connection-debian":   policy: PSK+ENCRYPT+TUNNEL+PFS+UP+IKEv2ALLOW+SAREFTRACK+lKOD+rKOD; prio: 32,28; interface: eth0;

## output truncated ##
000 #184: "demo-connection-debian":500 STATE_QUICK_R2 (IPsec SA established); EVENT_SA_REPLACE in 1653s; newest IPSEC; eroute owner; isakmp#183; idle; import:not set

## output truncated ##
000 #183: "demo-connection-debian":500 STATE_MAIN_I4 (ISAKMP SA established); EVENT_SA_REPLACE in 1093s; newest ISAKMP; lastdpd=-1s(seq in:0 out:0); idle; import:not set

The log file /var/log/pluto.log should also contain useful information regarding authentication, key exchanges and information on different phases of the tunnel. If your tunnel doesn’t come up, you could check there as well.

If you are sure that all the configuration is correct, and if your tunnel is still not coming up, you should check the following things.

  1. Many ISPs filter IPsec ports. Make sure that UDP 500, TCP/UDP 4500 ports are allowed by your ISP. You could try connecting to your server IPsec ports from a remote location by telnet.
  2. Make sure that necessary ports are allowed in the firewall of the server/s.
  3. Make sure that the pre-shared keys are identical in both end servers.
  4. The left and right parameters should be properly configured on both end servers.
  5. If you are facing problems with NAT, try using SNAT instead of MASQUERADING.

To sum up, this tutorial focused on the procedure of creating a site-to-site IPSec VPN tunnel in Linux using Openswan. VPN tunnels are very useful in enhancing security as they allow admins to make critical resources available only through the tunnels. Also VPN tunnels ensure that the data in transit is secured from eavesdropping or interception.

Tor

https://guardianproject.info/

這個感覺有點酷

雖然不熟網路工程

不過白話點就是 究極的加密連線, 一種結合p2p概念的網路連接

A to Z 經過的連線路徑是未知

真的滿酷的

下次出差匪區可以試試 XD

APP: https://play.google.com/store/apps/details?id=org.torproject.android&hl=zh_TW