June 2017
Intermediate to advanced
478 pages
13h 14m
English
The following script creates a virtual network between the network device called tap0 on the host and eth0 on the target using a pair of static IPv4 addresses, and then launches QEMU with the parameters to use tap0 as the emulated interface.
You will need to change the path to the root filesystem to be the full path to your staging directory and maybe the IP addresses if they conflict with your network configuration:
#!/bin/bashKERNEL=zImageDTB=versatile-pb.dtbROOTDIR=/home/chris/rootfsHOST_IP=192.168.1.1TARGET_IP=192.168.1.101NET_NUMBER=192.168.1.0NET_MASK=255.255.255.0sudo tunctl -u $(whoami) -t tap0sudo ifconfig tap0 ${HOST_IP}sudo route add -net ${NET_NUMBER} netmask ${NET_MASK} dev tap0sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" ...Read now
Unlock full access