1

I am running a custom linux image on Virtual box. Also,I am using a USB-to-Ethernet connector from my Laptop to connect other clients. In the network setting, I have used bridge adapter for both interfaces i.e. eth0 and Asix (usb-to-ethernet). When I am running virtual box, eth0 is getting public IP like 10.x.x.x but eth1(USB-to_eth) is not getting any IP.

I tried to run udhcpc on eth1 to get IP using dhcp but failed. Moreover, I assigned eth1 some IP in the same range as eth0 with eth0 as route. But still, no packets are reaching to eth0 from eth1. I tested the same by pinging other public IP via eth1 interface like ping -I eth1 10.x.x.x but failed.

I also tried iptables rules like below with:

echo "1" > /proc/sys/net/ipv4/ip_forward

iptables -I FORWARD -i eth0 -o eth1 -j ACCEPT
iptables -I FORWARD -i eth1 -o eth0 -j ACCEPT

cat /etc/network/interfaces doesn't show anything as there is no such file.

  • If you have both them bridged, it is the bridge interface that will get the IP. Add to the question /etc/network/interfaces please. – Rui F Ribeiro Oct 11 '16 at 19:44
  • And brctl show please – roaima Oct 11 '16 at 19:51
  • Two thoughts. 1. eth0 should not be getting any address; this might be a limitation of VirtualBox. 2. Your 10.* isn't a public IP. Please confirm whether this address is a NAT one from Virtual Box or whether it's the right addressing for your host's LAN. It something else. – roaima Oct 11 '16 at 19:55
  • cat /etc/network/interfaces doesn't show anything as there is no such file. eth0 is getting IP(10.x.x.x). Here public IP I mean company's network which is in the range of my laptop(10.x.x.x). – Deepen Oct 11 '16 at 19:57
  • The main reason is I want to connect another client to eth1(USB-to_ethernet) and I want that client to get Public IP. DHCP pcakets are reaching to eth1 but not getting forwarded to eth0. same case as before. – Deepen Oct 11 '16 at 20:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.