linux分析gre中断问题,Linux创建gre隧道 - Kvm.la - I'm alive, I'm here! 人生的两大悲剧:想要的没得到和想要的得到了。...

ubuntu

写入网卡/etc/network/interfaces

ubuntu通用auto tun0

iface tun0 inet static

address

netmask

pre-up iptunnel add tun1 mode gre local remote ttl 255

up ifconfig tun1 multicast

pointopoint

post-down iptunnel del tun1

Centos类方法

约定:

hostA IP:公网 100.xx.xx.101 内网10.0.0.1

hostB IP:公网192.xx.xx.101 内网10.0.0.2

HOST A配置cat /etc/sysconfig/network-scripts/ifcfg-tun0

DEVICE=tun0

BOOTPROTO=none

ONBOOT=no

TYPE=GRE

PEER_OUTER_IPADDR=192.xx.xx.102 #hostB IPv4

PEER_INNER_IPADDR=10.0.0.2

MY_INNER_IPADDR=10.0.0.1

host B配置cat /etc/sysconfig/network-scripts/ifcfg-tun0

DEVICE=tun0

BOOTPROTO=none

ONBOOT=no

TYPE=GRE

PEER_OUTER_IPADDR=100.xx.xx.101 #hostA IPv4

PEER_INNER_IPADDR=10.0.0.1

MY_INNER_IPADDR=10.0.0.2

设定好配置文件用ifup上线隧道做测试,ifdown下线隧道。ifup tun0

最后用ping和tcpdump抓包分析tcpdump -n -i eth1 proto 47

上述内容采摘整理自:

https://www.linickx.com/gre-example-for-centosrhel

https://onvox.net/articles/2009-01-19-how-to-create-ipv4-gre-tunnels-in-ubuntu

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值