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# 
  • 相关阅读:
    Google搜索解析
    情绪管理--不要总做“好脾气”的人。
    全排列的实现
    ORACLE触发器具体解释
    3、应用设置之界面标注
    C++ 排序函数 sort(),qsort()的使用方法
    muduo网络库使用心得
    探索WebKit内核(一)------ 菜鸟起步
    eclipse+webservice开发实例
    使用Jquery+EasyUI进行框架项目开发案例解说之中的一个---员工管理源代码分享
  • 原文地址:https://www.cnblogs.com/dream397/p/13539936.html
Copyright © 2011-2022 走看看