zoukankan      html  css  js  c++  java
  • vpp 通过配置文件配置接口

    startup-config /path_to_config_file
     配置TenGigabitEthernet4/0/0的ip地址和端口状态  
    set interface state TenGigabitEthernet4/0/0 up  
    set interface ip address TenGigabitEthernet4/0/0 2001:1a::1/64  
    # 配置默认路由  
    ip route add ::/0 via 2001:1a::2  
    # 配置GigabitEthernetb/0/0的ip地址和端口状态  
    set interface state GigabitEthernetb/0/0 up  
    set interface ip address GigabitEthernetb/0/0 10.0.0.1/24  
    # 配置TenGigabitEthernet13/0/0的ip地址和端口状态  
    set interface state TenGigabitEthernet13/0/0 up  
    set interface ip address TenGigabitEthernet13/0/0 10.1.0.1/24  
    # 新建Loopback端口,配置loopback地址和端口状态  
    loopback create-interface  
    set interface ip address loop0 fc00:1::1/64  
    set interface state loop0 up 
    unix {
      nodaemon
      log /var/log/vpp/vpp.log
      full-coredump
      cli-listen /run/vpp/cli.sock
      gid vpp
      startup-config /etc/vpp/interface.txt
    }
    root@gobgp:~# vi /etc/vpp/interface.txt
    set interface state GigabitEthernet7/0/0 up     
    set interface ip address GigabitEthernet7/0/0 192.168.123.3/24
    root@gobgp:~# systemctl restart   vpp
    root@gobgp:~# vppctl show interface addr
    GigabitEthernet7/0/0 (up):
      L3 192.168.123.3/24
    local0 (dn):
    root@gobgp:~# cat /etc/vpp/interface.txt
    set interface state GigabitEthernet7/0/0 up  
    set interface ip address GigabitEthernet7/0/0 192.168.123.3/24 
    root@gobgp:~#
    root@gobgp:~# ping 192.168.123.2
    connect: Network is unreachable
    root@gobgp:~# vppctl
        _______    _        _   _____  ___ 
     __/ __/ _   (_)__    | | / / _ / _ 
     _/ _// // / / / _    | |/ / ___/ ___/
     /_/ /____(_)_/\___/   |___/_/  /_/    
    
    
    vpp# ping 192.168.123.2
    116 bytes from 192.168.123.2: icmp_seq=2 ttl=64 time=.1428 ms
    116 bytes from 192.168.123.2: icmp_seq=3 ttl=64 time=.0896 ms
    116 bytes from 192.168.123.2: icmp_seq=4 ttl=64 time=.0839 ms
    116 bytes from 192.168.123.2: icmp_seq=5 ttl=64 time=.0847 ms
    
    root@gobgp:~# 
    vpp# sr policy add bsid cafe::1 next A1:: next B1:: next C1:: encap
    vpp# 
     
    vpp# show sr policies                                              
    SR policies:
    [0].-   BSID: cafe::1
            Behavior: Encapsulation
            Type: Default
            FIB table: 0
            Segment Lists:
            [0].- < a1::, b1::, c1:: > weight: 1
    -----------
    vpp# 
  • 相关阅读:
    flutter android 开发笔记(三.flutter和android数据交互)
    flutter android 开发笔记(二.module集成,混合页面)
    flutter android 开发笔记(一.集成)
    svn主干开辟分支、分支合并到主干
    svn主干开辟分支、分支合并到主干
    打包aar时把依赖的jar打包进aar中
    as修改已有项目的svn地址
    Flutter踩坑日记(一)
    android中两个不同名称的app不能同时安装
    aar、jar、so的引入和aar打包包含so、aar、jar文件
  • 原文地址:https://www.cnblogs.com/dream397/p/13539936.html
Copyright © 2011-2022 走看看