Olej писал(а): ↑19 авг 2023, 15:33
нужно запускаться с root.
Код: Выделить всё
olej@R420:~/2023/own.WORK/OpenWRT/ARM64$ sudo qemu-system-aarch64 -m 1024 -smp 2 -cpu cortex-a57 -M virt -nographic -kernel openwrt-armsr-armv8-generic-initramfs-kernel.bin -netdev type=tap,id=nic1,ifname=kvm0,script=no,downscript=no -device virtio-net-pci,disable-legacy=on,disable-modern=off,netdev=nic1,mac=ba:ad:1d:ea:01:02
[sudo] пароль для olej:
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd070]
[ 0.000000] Linux version 6.1.46 (builder@buildhost) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r23769-324673914d) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 SMP Fri Aug 18 21:45:16 2023
[ 0.000000] Machine model: linux,dummy-virt
[ 0.000000] efi: UEFI not found.
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000040000000-0x000000007fffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0x7fdeb3c0-0x7fdedfff]
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000040000000-0x000000007fffffff]
[ 0.000000] DMA32 empty
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000040000000-0x000000007fffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000007fffffff]
[ 0.000000] cma: Reserved 32 MiB at 0x000000007cc00000
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv0.2 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: Trusted OS migration not required
[ 0.000000] percpu: Embedded 19 pages/cpu s37224 r8192 d32408 u77824
[ 0.000000] Detected PIPT I-cache on CPU0
[ 0.000000] CPU features: detected: Spectre-v2
[ 0.000000] CPU features: detected: Spectre-v4
[ 0.000000] CPU features: detected: Spectre-BHB
[ 0.000000] CPU features: detected: ARM erratum 834220
[ 0.000000] CPU features: detected: ARM erratum 832075
[ 0.000000] CPU features: detected: ARM errata 1165522, 1319367, or 1530923
[ 0.000000] alternatives: applying boot alternatives
[ 0.000000] Fallback order for Node 0: 0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 258048
[ 0.000000] Policy zone: DMA
[ 0.000000] Kernel command line:
[ 0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 964752K/1048576K available (11328K kernel code, 1516K rwdata, 4128K rodata, 12224K init, 450K bss, 51056K reserved, 32768K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=2.
[ 0.000000] Tracing variant of Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] Root IRQ handler: gic_handle_irq
[ 0.000000] GICv2m: range[mem 0x08020000-0x08020fff], SPI[80:143]
[ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[ 0.000000] arch_timer: cp15 timer(s) running at 62.50MHz (virt).
[ 0.000000] clocksource: arch_sys_counter: mask: 0x1ffffffffffffff max_cycles: 0x1cd42e208c, max_idle_ns: 881590405314 ns
[ 0.000282] sched_clock: 57 bits at 63MHz, resolution 16ns, wraps every 4398046511096ns
[ 0.018411] Console: colour dummy device 80x25
[ 0.025293] printk: console [tty0] enabled
[ 0.031492] Calibrating delay loop (skipped), value calculated using timer frequency.. 125.00 BogoMIPS (lpj=625000)
[ 0.032067] pid_max: default: 32768 minimum: 301
[ 0.043656] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[ 0.043937] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[ 0.145731] cacheinfo: Unable to detect cache hierarchy for CPU 0
[ 0.171919] cblist_init_generic: Setting adjustable number of callback queues.
[ 0.172117] cblist_init_generic: Setting shift to 1 and lim to 1.
[ 0.177777] rcu: Hierarchical SRCU implementation.
[ 0.178001] rcu: Max phase no-delay instances is 1000.
[ 0.191344] EFI services will not be available.
[ 0.198993] smp: Bringing up secondary CPUs ...
[ 0.215049] Detected PIPT I-cache on CPU1
[ 0.217272] cacheinfo: Unable to detect cache hierarchy for CPU 1
[ 0.218586] CPU1: Booted secondary processor 0x0000000001 [0x411fd070]
[ 0.224373] smp: Brought up 1 node, 2 CPUs
[ 0.224558] SMP: Total of 2 processors activated.
[ 0.224717] CPU features: detected: 32-bit EL0 Support
[ 0.224798] CPU features: detected: 32-bit EL1 Support
[ 0.224942] CPU features: detected: CRC32 instructions
[ 0.227429] CPU features: emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching
[ 0.227889] CPU: All CPU(s) started at EL1
[ 0.228188] alternatives: applying system-wide alternatives
[ 0.267747] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.268321] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[ 0.272507] pinctrl core: initialized pinctrl subsystem
[ 0.289114] DMI not present or invalid.
[ 0.302401] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[ 0.322879] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[ 0.325076] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[ 0.325805] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[ 0.334990] thermal_sys: Registered thermal governor 'step_wise'
[ 0.335589] cpuidle: using governor ladder
[ 0.336043] cpuidle: using governor menu
[ 0.337355] ASID allocator initialised with 65536 entries
[ 0.341514] Serial: AMBA PL011 UART driver
[ 0.386879] 9000000.pl011: ttyAMA0 at MMIO 0x9000000 (irq = 13, base_baud = 0) is a PL011 rev1
[ 0.407178] printk: console [ttyAMA0] enabled
[ 0.457238] cryptd: max_cpu_qlen set to 1000
[ 0.465075] ACPI: Interpreter disabled.
[ 0.468616] iommu: Default domain type: Passthrough
[ 0.471343] SCSI subsystem initialized
[ 0.478905] usbcore: registered new interface driver usbfs
[ 0.480760] usbcore: registered new interface driver hub
[ 0.481678] usbcore: registered new device driver usb
[ 0.511527] clocksource: Switched to clocksource arch_sys_counter
[ 0.514906] pnp: PnP ACPI: disabled
[ 0.536917] NET: Registered PF_INET protocol family
[ 0.540715] IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)
[ 0.554303] tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes, linear)
[ 0.554906] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[ 0.555324] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[ 0.555971] TCP bind hash table entries: 8192 (order: 6, 262144 bytes, linear)
[ 0.556699] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.558663] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[ 0.559321] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[ 0.562434] NET: Registered PF_UNIX/PF_LOCAL protocol family
[ 0.563605] PCI: CLS 0 bytes, default 64
[ 0.567971] kvm [1]: HYP mode not available
[ 0.574240] workingset: timestamp_bits=42 max_order=18 bucket_order=0
[ 0.594377] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.594819] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.602936] 9p: Installing v9fs 9p2000 file system support
[ 0.610148] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[ 0.617804] atomic64_test: passed
[ 0.652547] pl061_gpio 9030000.pl061: PL061 GPIO chip registered
[ 0.662046] pci-host-generic 4010000000.pcie: host bridge /pcie@10000000 ranges:
[ 0.664712] pci-host-generic 4010000000.pcie: IO 0x003eff0000..0x003effffff -> 0x0000000000
[ 0.666801] pci-host-generic 4010000000.pcie: MEM 0x0010000000..0x003efeffff -> 0x0010000000
[ 0.667756] pci-host-generic 4010000000.pcie: MEM 0x8000000000..0xffffffffff -> 0x8000000000
[ 0.670594] pci-host-generic 4010000000.pcie: Memory resource size exceeds max for 32 bits
[ 0.672796] pci-host-generic 4010000000.pcie: ECAM at [mem 0x4010000000-0x401fffffff] for [bus 00-ff]
[ 0.676123] pci-host-generic 4010000000.pcie: PCI host bridge to bus 0000:00
[ 0.677399] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 0.678036] pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
[ 0.678685] pci_bus 0000:00: root bus resource [mem 0x10000000-0x3efeffff]
[ 0.679301] pci_bus 0000:00: root bus resource [mem 0x8000000000-0xffffffffff]
[ 0.684136] pci 0000:00:00.0: [1b36:0008] type 00 class 0x060000
[ 0.692225] pci 0000:00:01.0: [1af4:1041] type 00 class 0x020000
[ 0.692860] pci 0000:00:01.0: reg 0x14: [mem 0x00000000-0x00000fff]
[ 0.693294] pci 0000:00:01.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit pref]
[ 0.693875] pci 0000:00:01.0: reg 0x30: [mem 0x00000000-0x0007ffff pref]
[ 0.700038] pci 0000:00:01.0: BAR 6: assigned [mem 0x10000000-0x1007ffff pref]
[ 0.700884] pci 0000:00:01.0: BAR 4: assigned [mem 0x8000000000-0x8000003fff 64bit pref]
[ 0.701740] pci 0000:00:01.0: BAR 1: assigned [mem 0x10080000-0x10080fff]
[ 0.745745] EINJ: ACPI disabled.
[ 0.789929] virtio-pci 0000:00:01.0: enabling device (0000 -> 0002)
[ 0.798925] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[ 0.813295] cacheinfo: Unable to detect cache hierarchy for CPU 0
[ 0.866308] loop: module loaded
[ 0.869247] Loading iSCSI transport class v2.0-870.
[ 1.011508] usbcore: registered new interface driver usb-storage
[ 1.021605] rtc-pl031 9010000.pl031: registered as rtc0
[ 1.022824] rtc-pl031 9010000.pl031: setting system clock to 2023-08-19T11:44:38 UTC (1692445478)
[ 1.034652] sdhci: Secure Digital Host Controller Interface driver
[ 1.035081] sdhci: Copyright(c) Pierre Ossman
[ 1.036890] Synopsys Designware Multimedia Card Interface Driver
[ 1.039247] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.048903] hid: raw HID events driver (C) Jiri Kosina
[ 1.052163] usbcore: registered new interface driver usbhid
[ 1.052598] usbhid: USB HID core driver
[ 1.062473] NET: Registered PF_INET6 protocol family
[ 1.087098] Segment Routing with IPv6
[ 1.087646] In-situ OAM (IOAM) with IPv6
[ 1.088642] NET: Registered PF_PACKET protocol family
[ 1.089725] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[ 1.091346] 8021q: 802.1Q VLAN Support v1.8
[ 1.092957] 9pnet: Installing 9P2000 support
[ 1.151424] uart-pl011 9000000.pl011: no DMA platform data
[ 1.204991] Freeing unused kernel memory: 12224K
[ 1.253397] Run /init as init process
[ 4.691632] init: Console is alive
[ 4.808246] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[ 4.843837] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[ 4.859719] init: - preinit -
[ 8.713943] random: crng init done
[ 10.057378] 8021q: adding VLAN 0 to HW filter on device eth0
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[ 13.304607] procd: - early -
[ 14.464291] procd: - ubus -
[ 14.690156] procd: - init -
Please press Enter to activate this console.
[ 17.422026] urngd: v1.0.2 started.
[ 17.707813] kmodloader: loading kernel modules from /etc/modules.d/*
[ 18.014321] PPP generic driver version 2.4.2
[ 18.025514] NET: Registered PF_PPPOX protocol family
[ 18.072620] kmodloader: done loading kernel modules from /etc/modules.d/*
[ 48.036358] 8021q: adding VLAN 0 to HW filter on device eth0
[ 48.040165] br-lan: port 1(eth0) entered blocking state
[ 48.040584] br-lan: port 1(eth0) entered disabled state
[ 48.045006] device eth0 entered promiscuous mode
[ 48.097230] br-lan: port 1(eth0) entered blocking state
[ 48.097723] br-lan: port 1(eth0) entered forwarding state
[ 49.071832] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
BusyBox v1.36.1 (2023-08-18 21:45:16 UTC) built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt SNAPSHOT, r23769-324673914d
-----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
Код: Выделить всё
root@OpenWrt:/# ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br-lan state UP qlen 1000
link/ether ba:ad:1d:ea:01:02 brd ff:ff:ff:ff:ff:ff
3: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether ba:ad:1d:ea:01:02 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.1/24 brd 192.168.1.255 scope global br-lan
valid_lft forever preferred_lft forever
inet6 fd83:2e14:76da::1/60 scope global noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::b8ad:1dff:feea:102/64 scope link
valid_lft forever preferred_lft forever
И в это время уже на хосте появился новый интерйейс:
Код: Выделить всё
olej@R420:~$ ip a s
...
7: kvm0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 4e:eb:68:0c:cc:8e brd ff:ff:ff:ff:ff:ff
Не инициализированный
И естественно:
Код: Выделить всё
olej@R420:~$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.14 icmp_seq=1 Destination Host Unreachable
From 192.168.1.14 icmp_seq=2 Destination Host Unreachable
From 192.168.1.14 icmp_seq=3 Destination Host Unreachable
From 192.168.1.14 icmp_seq=4 Destination Host Unreachable
From 192.168.1.14 icmp_seq=5 Destination Host Unreachable
From 192.168.1.14 icmp_seq=6 Destination Host Unreachable
^C
--- 192.168.1.1 ping statistics ---
8 packets transmitted, 0 received, +6 errors, 100% packet loss, time 7172ms
pipe 4
Через пень-колоду
но пока так:
Код: Выделить всё
olej@R420:~$ sudo ifconfig kvm0 192.168.1.200 up
[sudo] пароль для olej:
olej@R420:~$ ip a s dev kvm0
7: kvm0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether 4e:eb:68:0c:cc:8e brd ff:ff:ff:ff:ff:ff
inet 192.168.1.200/24 brd 192.168.1.255 scope global kvm0
valid_lft forever preferred_lft forever
inet6 fe80::4ceb:68ff:fe0c:cc8e/64 scope link
valid_lft forever preferred_lft forever
Код: Выделить всё
olej@R420:~$ route -n
Таблица маршутизации ядра протокола IP
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.3 0.0.0.0 UG 100 0 0 eno1
0.0.0.0 192.168.1.3 0.0.0.0 UG 101 0 0 eno2
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eno1
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 kvm0
192.168.1.0 0.0.0.0 255.255.255.0 U 100 0 0 eno1
192.168.1.0 0.0.0.0 255.255.255.0 U 101 0 0 eno2
И всё поехало:
Код: Выделить всё
olej@R420:~$ ping -c3 -Ikvm0 192.168.1.1
PING 192.168.1.1 (192.168.1.1) from 192.168.1.200 kvm0: 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=15.4 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=1.38 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=1.84 ms
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 1.377/6.216/15.429/6.517 ms
И навстречу из VM:
Код: Выделить всё
root@OpenWrt:/# ping 192.168.1.200 -c3 -Ibr-lan
PING 192.168.1.200 (192.168.1.200): 56 data bytes
64 bytes from 192.168.1.200: seq=0 ttl=64 time=5.318 ms
64 bytes from 192.168.1.200: seq=1 ttl=64 time=3.034 ms
64 bytes from 192.168.1.200: seq=2 ttl=64 time=2.627 ms
--- 192.168.1.200 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 2.627/3.659/5.318 ms