I am trying to make a VLC/LiFi router using 2 beaglebones and additional circuitry. They are running on Debian based Linux. One is to act as the router for the other. The router has an Ethernet cable connected to it which provides it an internet connection. They each have a VLC network interface which was developed and configured by me. They are on the same subnet. The router is 192.168.0.1 and the client is 192.168.0.2. I have setup the routing and forwarding so that all traffic from the eth0 port goes through vlc0. This is what I used to set it up:
echo "1" > sudo /proc/sys/net/ipv4/ip_forward modprobe ip_tables modprobe ip_conntrack modprobe ip_conntrack_irc modprobe ip_conntrack_ftp iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE iptables -A FORWARD -i vlc0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i eth0 -o vlc0 -j ACCEPT iptables -t nat -A PREROUTING -d 192.168.0.1 -j DNAT --to-destination 192.168.0.2
On the client side I have 192.168.0.1 setup as the default gateway so that all traffic goes out through the vlc0 interface.
With this setup I can ping any IP address without a problem but I cannot ping any urls like google.com. I have tried changing the information on the resolv.conf file on the client with various nameservers like 126.96.36.199 and a local one that is used by the server. None of this has worked.
The server works just fine pinging anything and browsing the web.
I did captures with Wireshark to see what packets are being sent and I see the DNS request being sent out but no reply.