SIT隧道以及FOU GUE封裝

2021-09-05 08:56:34 字數 2687 閱讀 8364

單純的sit隧道配置如下:

host-a:

ip link add sit01 type sit local 10.10.10.103 remote 10.10.10.145 ttl 255

ip link set sit01 up

ip addr add 3ffe:6::1/96 dev sit01

host-b:

ip link add sit01 type sit local 10.10.10.145 remote 10.10.10.103 ttl 255

ip link set sit01 up

ip addr add 3ffe:6::2/96 dev sit01

登入主機a,測試連通性:

host-a $ ping6 3ffe:6::2

ping 3ffe:6::2(3ffe:6::2) 56 data bytes

64 bytes from 3ffe:6::2: icmp_seq=1 ttl=64 time=0.744 ms

以下為使用tcpdump抓取的資料報文,外層為ipv4頭部,內層為ipv6頭部:

檢視內層的ipv4頭部資訊,可見其協議號為41,即ipv6-in-ipv4。

主機a配置如下,設定fou接收埠為6666,協議號41為ipv6-in-ipv4隧道協議:

ip fou add port 6666 ipproto 41

ip link add sit01 type sit local 10.10.10.103 remote 10.10.10.145 ttl 255 encap fou encap-sport auto encap-dport 5555

ip link set sit01 up

ip addr add 3ffe:6::1/96 dev sit01

主機b配置如下,設定其fou封裝接收埠為5555,對應sit隧道裝置sit01的目的埠encap-dport(5555)。

ip fou add port 5555 ipproto 41

ip link add sit01 type sit local 10.10.10.145 remote 10.10.10.103 ttl 255 encap fou encap-sport auto encap-dport 6666

ip link set sit01 up

ip addr add 3ffe:6::2/96 dev sit01

登入主機a測試連通性:

host-a $ ping6 3ffe:6::2

使用tcpdump抓取到的資料報文如下,相比如沒有fou封裝的sit隧道報文,增加了udp頭部,ipv6報文作為udp的載荷存在:

主機a配置如下,設定gue接收埠為7777,gue封裝與fou不同,其不需要在配置命令中指定協議型別,協議型別包含在資料報的gue頭部中:

ip fou add port 7777 gue

ip link add sit01 type sit local 10.10.10.103 remote 10.10.10.145 ttl 255 encap gue encap-sport auto encap-dport 8888 encap-csum encap-remcsum

ip link set sit01 up

ip addr add 3ffe:6::1/96 dev sit01

主機b配置如下,設定其gue封裝接收埠為8888,對應sit隧道裝置sit01的目的埠encap-dport(8888)。

ip fou add port 8888 gue

ip link add sit01 type sit local 10.10.10.145 remote 10.10.10.103 ttl 255 encap gue encap-sport auto encap-dport 7777 encap-csum encap-remcsum

ip link set sit01 up

ip addr add 3ffe:6::2/96 dev sit01

登入主機a測試連通性:

host-a $ ping6 3ffe:6::2

使用tcpdump抓取資料報如下,gue頭部資訊為00 29 00 00:

主機a:ubuntu 17.04,ip命令版本:ip utility, iproute2-ss161212。

主機b:ubuntu 18.04.1 lts,ip工具版本:ip utility, iproute2-ss180129

動畫以及封裝

offset client scroll 系列 offset系列 offsetleft 獲取元素距離最左邊的距離 如果父元素沒有定位,距離瀏覽器最左側的距離 如果父元素有定位,距離父元素最左側的距離 offsetwidth 獲取元素的寬度,包括border及以內,不包括margin offsethe...

GRE 三層隧道封裝配置

實驗拓撲圖 1.實驗說明 路由器site1和site2分別模擬公司的兩個站點,1.1.1.0 24和2.2.2.0 24分別模擬兩個站點的內部網路 路由器isp模擬服務商路由器。通過ger技術在site1和site2之間建立乙個點對點的gre隧道,並在gre隧道口上執行ospf,以學習彼此的內部網路...

為什麼隧道封裝是Docker多數網路專案的共同選擇

背景 解析原因 隧道封裝是目前最簡單的穿透docker容器複雜網路環境安全設定的方法 實際上這個問題最重要的原因是與docker容器執行環境的多樣複雜性是直接相關的。我們都知道docker容器可以執行在公有雲 私有雲 虛擬化以及裸機上。為了網路的安全,這些環境上都應該有嚴格的安全組和防火牆設定來保障...