• kata 网卡 + mount -t proc proc /proc


    -netdev tap,ifname=tap1,id=network-0,vhost=on,script=no,downscript=no 
                     -device driver=virtio-net-pci,netdev=network-0,mac=02:42:ac:11:00:02,disable-modern=false,mq=on,vectors=4,romfile= 

    root@cloud:/data1/core# ps -elf | grep vhost-8220
    1 S root      8225     2  0  80   0 -     0 vhost_ 11:17 ?        00:00:00 [vhost-8220]
    root@cloud:/data1/core# ip a
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host 
           valid_lft forever preferred_lft forever
    2: enahisic2i0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
        link/ether 9c:52:f8:67:c4:d3 brd ff:ff:ff:ff:ff:ff
        inet 10.10.16.47/24 brd 10.10.16.255 scope global enahisic2i0
           valid_lft forever preferred_lft forever
        inet6 fe80::9e52:f8ff:fe67:c4d3/64 scope link 
           valid_lft forever preferred_lft forever
    3: enahisic2i1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
        link/ether 9c:52:f8:67:c4:d4 brd ff:ff:ff:ff:ff:ff
    4: enahisic2i2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
        link/ether 9c:52:f8:67:c4:d5 brd ff:ff:ff:ff:ff:ff
        inet 10.10.104.47/24 scope global enahisic2i2
           valid_lft forever preferred_lft forever
        inet6 fe80::9e52:f8ff:fe67:c4d5/64 scope link 
           valid_lft forever preferred_lft forever
    5: enahisic2i3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
        link/ether 9c:52:f8:67:c4:d6 brd ff:ff:ff:ff:ff:ff
    6: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
        link/ether 02:42:99:67:f5:bc brd ff:ff:ff:ff:ff:ff
        inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
           valid_lft forever preferred_lft forever
        inet6 fe80::42:99ff:fe67:f5bc/64 scope link 
           valid_lft forever preferred_lft forever
    105: virbr0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
        link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    109: tap1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
        link/ether 66:31:bf:3b:f8:95 brd ff:ff:ff:ff:ff:ff
    root@cloud:/data1/core# brctl show
    bridge name     bridge id               STP enabled     interfaces
    docker0         8000.02429967f5bc       no
    virbr0          8000.000000000000       no
    root@cloud:/data1/core# 
    root@cloud:/data1/core# ip link set tap1 up
    
    root@cloud:/data1/core# ip a add 192.168.122.49/24 dev tap1
    root@cloud:/data1/core# ping 192.168.122.48
    PING 192.168.122.48 (192.168.122.48) 56(84) bytes of data.
    64 bytes from 192.168.122.48: icmp_seq=1 ttl=64 time=0.852 ms
    64 bytes from 192.168.122.48: icmp_seq=2 ttl=64 time=0.116 ms
    ^C
    --- 192.168.122.48 ping statistics ---
    2 packets transmitted, 2 received, 0% packet loss, time 1032ms
    rtt min/avg/max/mdev = 0.116/0.484/0.852/0.368 ms

    虚拟机

    root@(none):/# ip a
    1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
        link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff
    root@(none):/# ip link set eth0 up
    root@(none):/# ip a add 192.168.122.48/24 dev eth0
    root@(none):/# ip a
    1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff
        inet 192.168.122.48/24 scope global eth0
           valid_lft forever preferred_lft forever
        inet6 fe80::42:acff:fe11:2/64 scope link 
           valid_lft forever preferred_lft forever
    root@(none):/# 

  • 相关阅读:
    MFC Document/View 3
    MFC Document/View 2
    c++基本类型&&&c++string与c风格字符串的相互转化
    C++不同变量所在内存&&new malloc的区别
    C# 操作Excel 复选框
    prepareStatement与Statement的区别
    Oracle查询用户所有表、字段等信息
    同样的用户和密码,PL/SQL可以正常登录,C#程序却出现 ORA-1017 用户名/口令无效
    javascript原生态的同步异步请求实现
    SQL 数据库是否安全
  • 原文地址:https://www.cnblogs.com/dream397/p/13968453.html
Copyright © 2020-2023  润新知