首页 > 编程知识 正文

gre还是gmat,矩形隧道

时间:2023-05-04 12:15:28 阅读:116662 作者:1027

简单的GRE隧道构建1 .网络拓扑

2 .创建GRE隧道2.1.Linux虚拟机(ubuntu18.04系统)2.1.1.IPR1配置:

# IP链接集eth0up

# ipadd radd 169.254.1.108/24 deveth 0

#ip link set eth1 up

# ipadd radd 169.254.2.108/24 devet h1

R2 :

# IP链接集eth0up

# ipadd radd 169.254.1.109/24 deveth 0

#ip link set eth1 up

# ipadd radd 169.254.3.109/24 devet h1

2.1.2 .创建GRE接口R1 :

# iptunneladdgre1modegrelocal 169.254.1.108 remote 169.254.1.109 deveth 0密钥1c sum (隧道接口地址local,remote ) )

# IP链接集GRE8up

# ipadd radd 10.10.10.1 peer 10.10.10.2/24 dev GRE1(隧道内地址)

R2 :

# iptunneladdgre1modegrelocal 169.254.1.109 remote 169.254.1.108 deveth 0密钥1c sum (隧道接口地址local,remote ) )

# IP链接集GRE9up

# ipadd radd 10.10.10.2 peer 10.10.10.1/24 dev GRE1(隧道内地址)

2.1.3 .创建静态路由R1 :

# IP路由169.254.3.0/24 via 10.10.10.1

R2 :

# IP路由169.254.2.0/24 via 10.10.10.2

2.2 .路由器配置2.2.1.GRE接口创建和R1:配置(仅需要在红框中配置,R2也是如此) ) )。

2.2.2 .创建静态路由(使用动态路由协议时不需要手动创建) R1 :

3 .验证(1) GRE接口打开(up )时,在L2机器上R1机器的eth0、eth1有响应;

)2) GRE接口关闭(down )时,L2机器上R1机器的eth0、eth1没有响应。

包分析:

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。