May 2017
Beginner to intermediate
470 pages
10h 49m
English
To initialize eth1, we can refer to the initialization of eth0 in the emulator. The network interface eth0 is initialized in the system/etc/init.goldfish.sh shell script as follows:
#!/system/bin/sh # Setup networking when boot starts ifconfig eth0 10.0.2.15 netmask 255.255.255.0 up route add default gw 10.0.2.2 dev eth0 ...
As we can see, a fixed IP address 10.0.2.15 is assigned to the eth0 interface. We can add the following commands to initialize the interface eth1:
ifconfig eth1 up dhcpcd -d eth1
In the preceding commands, we enable the interface eth1 first using the ifconfig command. Then, instead of using a fixed IP address, we use the DHCP client to get the IP address for eth1.
As we discussed ...
Read now
Unlock full access