zuier 发表于 2018-7-14 13:36:13

linux tunnel 与cisco 三层交换机的tunnel互联

  一、环境介绍:
  1.1 Ubuntu :Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux12
  (跟版本问题不是太大,只有内核支持)
  1.2 Cisco 三层交换版本:
  Model number                  : WS-C3750X-24T-E
  (升级到)版本:License Level: ipservices
  二、linux 下的操作:(复制粘贴)
  modprobe ip_gre
  iptunnel add tun0 mode gre remote 10.23.30.1local 10.23.30.206 ttl 225
  ifconfig tun0 172.16.1.2/24
  ifconfig tun0 up
  ifconfig tun0 pointopoint 172.16.1.1
  ifconfig tun0 multicast
  三、交换机配置:
  需要配置tunnel网上一大堆:
  interface Tunnel0
  ip address 172.16.1.1 255.255.255.0
  tunnel source 10.23.30.1
  tunnel destination 10.23.30.206
  四、测试:
  1.在局域网中 ping 一下 172.16.1.1 (交换机的tunnel0)通:
  2.登录交换机中ping 172.16.1.2 (Ubuntu的tun0口地址) 通:
  3.通过Ubuntu的tcpdump 抓包看一下:
  root@123-System-Product-Name:~# tcpdump-i tun0 host 172.16.1.1
  tcpdump: verbose output suppressed, use -v or -vv for full protocol decode

  listening on tun0, link-type LINUX_SLL (Linux cooked), capture>
  17:05:39.216787 IP bogon > bogon: ICMP echo request,>
  17:05:39.216804 IP bogon > bogon: ICMP echo reply,>
  17:05:39.219220 IP bogon > bogon: ICMP echo request,>
  17:05:39.219226 IP bogon > bogon: ICMP echo reply,>
  17:05:39.221597 IP bogon > bogon: ICMP echo request,>
  17:05:39.221600 IP bogon > bogon: ICMP echo reply,>
  17:05:39.223529 IP bogon > bogon: ICMP echo request,>
  17:05:39.223532 IP bogon > bogon: ICMP echo reply,>
  17:05:39.226182 IP bogon > bogon: ICMP echo request,>
  17:05:39.226185 IP bogon > bogon: ICMP echo reply,>  五、注意事项
  1.注意配置tunnel接口的ip地址的时候,需要同一个网段。
  2.配置linux tunnel的时候ttl的值最好加入。原因是如果通过zebra 路由发布的时候(ospf rip等),特别是跨网段的时候,ttl的重要性显示出来了。
  3.回头在加上加密方式(AH ESP),这些在linux上运行了,不知cisco支持不?
  4.出问题查现象,然后扣理论。多和朋友进行沟通。
  写到这吧,当个记录。。。
页: [1]
查看完整版本: linux tunnel 与cisco 三层交换机的tunnel互联