ROS7: 与Linux建立GRE隧道

网络信息

区域网卡WAN_IPGRE_IP说明
SGeth01.2.3.410.11.55.2/30Debian12
CNbr-lan5.6.7.810.11.55.1/30ROS7

Debian端配置(SG)

添加GRE模块

modprobe ip_gre ip6_gre

设置GRE隧道

#说明:mtu 1414根据ros的gre接口上的mtu来设置
ip tunnel add gre4-to-cn mode gre remote 5.6.7.8 local 1.2.3.4 ttl 64
ip link set gre4-to-sky up mtu 1414
ip addr add 10.11.55.2 peer 10.11.55.1 dev gre4-to-cn

GRE接口管理

ip link set gre1 down    # 断开GRE隧道
ip tunnel del gre1         # 删除GRE隧道
ip addr show               # 查看GRE信息

开启GRE keepalive

#如果没有数据,GRE隧道默认会断掉
#下面的方法不一定有效,如无效可用第三方案保持连接

vim /etc/sysctl.conf
net.ipv4.conf.default.accept_local=1
net.ipv4.conf.all.accept_local=1
sysctl -p


ROS端配置(CN)

.

.

.

Comments

No comments yet. Why don’t you start the discussion?

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注