网络信息
区域 | 网卡 | WAN_IP | GRE_IP | 说明 |
---|---|---|---|---|
SG | eth0 | 1.2.3.4 | 10.11.55.2/30 | Debian12 |
CN | br-lan | 5.6.7.8 | 10.11.55.1/30 | ROS7 |
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)

.
.
.