Hi,
I'm trying to do something similar to Vincent Li. In vbox I configure the first network (eth0) in bridge mode and the second (eth1) host-only.
This configuration works fine using 2.2-r2, 4.2, 4.4-41 and 4.4-r3, etc: eth0 comes up with an ip address and uses the dns server to resolve names.
I configure the host only like this:
# ifconfig eth1 192.168.56.2 netmask 255.255.255.0 up
and it works great - host and guest can ping each other on 192.168.56, adb works, etc. I don't need to make any firewall rules or other changes.
When I use same config on lollipop host and guest cannot ping each other. Here's eth0 (bridge)
# ip route
default via 192.168.2.3 dev eth0 metric 204
192.168.2.0/24 dev eth0 proto kernel scope link src 192.168.2.27 metric 204
# ifconfig eth1 192.168.56.2 netmask 255.255.255.0 up
# ip route
default via 192.168.2.3 dev eth0 metric 204
192.168.2.0/24 dev eth0 proto kernel scope link src 192.168.2.27 metric 204 #ip route get 192.168.56.1
192.168.56.1 via 192.168.2.3 dev eth0 src 192.168.2.27
Note that the route to 192.168.56.1 goes through the wrong interface - eth0 - instead of eth1, so host and guest can't ping each other on 192.168.56
If I switch the nics - make the first one host only and second bridge - neither interface gets an ip address by default at boot:
# ip route
#
The bridge doesn't get ip addr from dhcp. I can use the ifconfig command from above:
# ifconfig eth0 192.168.56.2 netmask 255.255.255.0 up
# ifconfig eth1 192.168.2.105 netmask 255.255.255.0 up
and then get this:
# ip route
# ip route get 192.168.56.1
192.168.56.1 dev eth0 src 192.168.56.2
# ip route get 192.168.2.10
192.168.2.10 dev eth1 src 192.168.2.105
and guest and host can ping each other.
When I make eth0 bridged it uses dhcp to acquire an ip address and dns server address. But when I make the local host eth0 and bridge eth1, eth1 does not get an ip address and dns server address.
I'd be grateful if someone could tell me how to configure things so that eth1 comes up configured with an ip address and dns server like it does as eth0.
Barring that, I'd like to know how to configure eth1 manually for dns. I added an entry to resolv.conf but it has no effect that I can see:
# cat /etc/resolv.conf
nameserver 192.168.2.10
# ip route get 192.168.2.10
192.168.2.10 dev eth1 src 192.168.2.105
I can ping all the machines on 192.168.2 using their ip addresses but dns isn't working. It's fine on earlier versions - 2.2, 4.2, 4.4, etc.
Will