mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 08:53:29 +00:00
Enable tap mode network and vhost
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
1b23182dcc
commit
7c3e3738a1
19
tools/net/qemu-ifup.sh
Executable file
19
tools/net/qemu-ifup.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
# Create a TAP interface.
|
||||
#
|
||||
# It's used for the startup script of QEMU netdev, DO NOT run it manually.
|
||||
|
||||
# This IP address should be set the same as gateway address of Asterinas
|
||||
IP=10.0.2.2/24
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
ip addr add $IP dev "$1"
|
||||
ip link set dev "$1" up
|
||||
exit
|
||||
else
|
||||
echo "Error: no interface specified"
|
||||
exit 1
|
||||
fi
|
Reference in New Issue
Block a user