searchusermenu
  • 发布文章
  • 消息中心
点赞
收藏
评论
分享
原创

ipip和sctp协议连通性方法

2023-10-26 06:44:07
48
0

ipip协议

1、简介

ipip,即IPv4 in IPv4,是由Linux系统内核实现的IP隧道。

IPIP 隧道是一种三层隧道,是将一个IP报文封装在另一个IP报文的技术,通过两端的路由做tunnel,把两个本来不通的网络通过点对点连接起来。

 

2、ipip隧道搭建

ipip 需要内核模块 ipip.ko的支持。

 

查看内核是否加载ipip模块:lsmod | grep ipip

加载ipip: modprobe ipip

删除 ipip:modprobe -r ipip

 

加载ipip模块后,在192.168.1.2 和 192.168.1.3之间创建ipip隧道方法如下:

在vm1上添加如下配置:

ip tunnel add ipip0 mode ipip local 10.0.2.2 remote 10.0.3.3

ip addr add 192.168.1.2/24 dev ipip0

ip link set ipip0 up

 

在vm2上添加如下配置:

ip tunnel add ipip0 mode ipip local 10.0.3.3 remote 10.0.2.2

ip addr add 192.168.1.3/24 dev ipip0

ip link set ipip0 up

 

至此,ipip隧道搭建完成。

 

3、ipip连通性验证

以vm1作为server端,vm2作为client端为例,icmp/tcp/udp经由ipip隧道的连通性方式如下:

icmp:

client端:ping 192.168.1.2 -i 1

 

tcp:

server端:iperf3 -s

client端:iperf3 -c 192.168.1.2 -i 1

 

udp:

server端:iperf3 -s

client端:iperf3 -c 192.168.1.2 -i 1 -u

 

sctp协议
1、简介

SCTP(Stream Control Transmission Protocol)流控制传输协议,是一种连接网络两端,同时传输多个数据流的协议,它提供的服务与UDP和TCP类似。

 

2、sctp搭建

首先,下载安装lksctp-tools工具,安装方法可自行搜索,这里不作展开。

 

查看内核是否加载sctp模块:lsmod | grep sctp

加载sctp: modprobe sctp

删除sctp:modprobe -r sctp

 

3、sctp连通性验证

sctp支持ipv4地址和ipv6地址。

 

ipv4:

server端:sctp_test -H 10.0.2.2 -P 5005 –l

client端:sctp_test -H 10.0.3.3 -P 5006 -h 10.0.2.2 -p 5005 -s -x 1 –c 4

 

ipv6:

server端:sctp_test -H 100:1:1a3:4601:edef:203c:2f3b:3c0a -P 5005 –l

client端:sctp_test -H 100:1:1a3:4600:ee82:afb0:2326:cf4b -P 5006 -h 100:1:1a3:4601:edef:203c:2f3b:3c0a -p 5005 -s -x 1 –c 4

 

0条评论
0 / 1000
陈****云
1文章数
0粉丝数
陈****云
1 文章 | 0 粉丝
陈****云
1文章数
0粉丝数
陈****云
1 文章 | 0 粉丝
原创

ipip和sctp协议连通性方法

2023-10-26 06:44:07
48
0

ipip协议

1、简介

ipip,即IPv4 in IPv4,是由Linux系统内核实现的IP隧道。

IPIP 隧道是一种三层隧道,是将一个IP报文封装在另一个IP报文的技术,通过两端的路由做tunnel,把两个本来不通的网络通过点对点连接起来。

 

2、ipip隧道搭建

ipip 需要内核模块 ipip.ko的支持。

 

查看内核是否加载ipip模块:lsmod | grep ipip

加载ipip: modprobe ipip

删除 ipip:modprobe -r ipip

 

加载ipip模块后,在192.168.1.2 和 192.168.1.3之间创建ipip隧道方法如下:

在vm1上添加如下配置:

ip tunnel add ipip0 mode ipip local 10.0.2.2 remote 10.0.3.3

ip addr add 192.168.1.2/24 dev ipip0

ip link set ipip0 up

 

在vm2上添加如下配置:

ip tunnel add ipip0 mode ipip local 10.0.3.3 remote 10.0.2.2

ip addr add 192.168.1.3/24 dev ipip0

ip link set ipip0 up

 

至此,ipip隧道搭建完成。

 

3、ipip连通性验证

以vm1作为server端,vm2作为client端为例,icmp/tcp/udp经由ipip隧道的连通性方式如下:

icmp:

client端:ping 192.168.1.2 -i 1

 

tcp:

server端:iperf3 -s

client端:iperf3 -c 192.168.1.2 -i 1

 

udp:

server端:iperf3 -s

client端:iperf3 -c 192.168.1.2 -i 1 -u

 

sctp协议
1、简介

SCTP(Stream Control Transmission Protocol)流控制传输协议,是一种连接网络两端,同时传输多个数据流的协议,它提供的服务与UDP和TCP类似。

 

2、sctp搭建

首先,下载安装lksctp-tools工具,安装方法可自行搜索,这里不作展开。

 

查看内核是否加载sctp模块:lsmod | grep sctp

加载sctp: modprobe sctp

删除sctp:modprobe -r sctp

 

3、sctp连通性验证

sctp支持ipv4地址和ipv6地址。

 

ipv4:

server端:sctp_test -H 10.0.2.2 -P 5005 –l

client端:sctp_test -H 10.0.3.3 -P 5006 -h 10.0.2.2 -p 5005 -s -x 1 –c 4

 

ipv6:

server端:sctp_test -H 100:1:1a3:4601:edef:203c:2f3b:3c0a -P 5005 –l

client端:sctp_test -H 100:1:1a3:4600:ee82:afb0:2326:cf4b -P 5006 -h 100:1:1a3:4601:edef:203c:2f3b:3c0a -p 5005 -s -x 1 –c 4

 

文章来自个人专栏
文章 | 订阅
0条评论
0 / 1000
请输入你的评论
0
0