码迷,mamicode.com
首页 > 其他好文 > 详细

creates 2 connected namespaces vpp1 & vpp2

时间:2020-04-23 12:39:24      阅读:84      评论:0      收藏:0      [点我收藏+]

标签:smo   tap   bsp   creates   slide   inner   file   exec   lob   

#!/bin/bash
  #
  # set up a network env with 2 namespaces:
  #
  # [ vpp1 ]------[vpp]------[ vpp2 ]
  #
  # vpp1: 192.168.0.1
  # vpp2: 192.168.0.2
   
  ip netns delete vpp1
  ip netns delete vpp2
  ip netns add vpp1
  ip netns add vpp2
   
  vppctl tap connect vpp1
  vppctl tap connect vpp2
  vppctl set interface state tap-0 up
  vppctl set interface state tap-1 up
  ip link set dev vpp1 netns vpp1
  ip link set dev vpp2 netns vpp2
  ip netns exec vpp1 ip link set vpp1 up
  ip netns exec vpp2 ip link set vpp2 up
   
  vppctl set interface l2 bridge tap-0 23
  vppctl set interface l2 bridge tap-1 23
   
  ip netns exec vpp1 ip addr add 192.168.0.1/24 dev vpp1
  ip netns exec vpp2 ip addr add 192.168.0.2/24 dev vpp2
   
  # smoke-test
  ip netns exec vpp1 ping -c1 192.168.0.2
  ip netns exec vpp2 ping -c1 192.168.0.1

https://www.slideshare.net/npsg/vpp-72218327

creates 2 connected namespaces vpp1 & vpp2

标签:smo   tap   bsp   creates   slide   inner   file   exec   lob   

原文地址:https://www.cnblogs.com/dream397/p/12759548.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!