LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-06-2016, 05:15 PM   #1
jackie123
LQ Newbie
 
Registered: Nov 2016
Posts: 2

Rep: Reputation: Disabled
DNS Issue - Trying to make a LiFi Router


I am trying to make a VLC/LiFi router using 2 beaglebones and additional circuitry. They are running a Debian based Linux. One is to act as the router for the other. It 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. 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 8.8.8.8 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.
 
Old 11-06-2016, 06:28 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,680

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Although it will not fix your DNS problem your rules are somewhat backwards.
With eth0 being your external network and vlc0 internal the rules should be:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

iptables -A FORWARD -i eth0 -o vlc -m state --state RELATED,ESTABLISHED -j ACCEPT (only forwards traffic that has been initiated by your client)

iptables -A FORWARD -i vlc0 -o eth0 -j ACCEPT (forwards all traffic from your client to the external network)

With basic NAT the prerouting rule is not required. Your vlc0 subnet is 192.168.0.0/24 but what is the eth0 subnet?
 
Old 11-07-2016, 04:35 PM   #3
jackie123
LQ Newbie
 
Registered: Nov 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you for your help. I wasn't 100% sure about the 2 forwarding rules. It worked just fine with just the Masquerade rule. I was trying everything I could to get it to work. The eth0 is on a different subnet. It depends on where I connect but its not the same the same as my vlc0 subnet.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic DNS with router update - How to configure DNS name server? Thomas Korimort Linux - Networking 1 07-25-2016 07:57 AM
[SOLVED] Question about my router DNS and DNS settings on my Linux OS. linustalman Linux - Networking 1 09-14-2015 07:21 PM
Wireless router trouble: successful connection but no internet access...DNS issue? R00ts General 2 03-05-2010 01:26 PM
DNS issue - DNS works perfect on server but not on any other computer jtneal Linux - Networking 3 03-15-2008 03:30 PM
i want make DNS server on fedora 8 opreting system plz tell me what is file use DNS nitin gupta Linux - Newbie 2 02-20-2008 05:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration