LinuxQuestions.org
Help answer threads with 0 replies.
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 03-15-2014, 11:31 PM   #1
randdeveloper
Member
 
Registered: Jun 2013
Distribution: linux mint xfce
Posts: 42

Rep: Reputation: Disabled
linux as router/gateway unable to route LAN to WAN


I could really use some help in setting up Ubuntu as a router/gateway. I've read all relevant material I can find in LQ and the Ubuntu forums but am still running into problems. I'm a relative linux noob.

Setup: WAN hardwired to Ubuntu and getting ip by DHCP on the router/modem; Ubuntu running DHCP hardwired to another (Linksys WRT120N) router that is acting as a switch. Other computer connected to the Linksys is running Linux Mint 13.

Details:
-Ubuntu machine
eth0 is the WAN ip 192.168.1.100 set by DHCP from my ATT router/modem
eht1 is the LAN ip statically set to 10.14.82.1
DHCP is on eht1 LAN
-Linksys router
set to DHCP and here's what it got:
ip 10.14.82.56 subnet 255.255.255.0
default gateway 10.14.82.1 (the Ubuntu static ip)
DNS1 8.8.8.8 DNS2 8.8.4.4 (I set these)
-Linux Mint machine
ip 10.14.82.50 mask 255.255.255.0
gateway 10.14.82.1
-Firewall ip FILTER tables set to
INPUT rules:
ACCEPT INPUT eth1
ACCEPT INPUT eth0 for ESTABLISHED, RELATED
FORWARD rules:
ACCEPT INPUT eth1 to OUTPUT eth0
ACCEPT INPUT eth0 to OUTPUT eth1 for ESTABLISHED, RELATED
DEFAULT action:
drop for INPUT and FORWARD
accept for all others including NAT and mangle
-DHCP entry:
subnet 10.14.82.0 netmask 255.255.255.0 {
range 10.14.82.45 10.14.82.100;
option subnet-mask 255.255.255.0;
option broadcast-address 10.14.82.255;
option domain-name-servers 8.8.8.8, 8.8.4.4;
option routers 10.14.82.1;
}

Problems:
1. On the Linux Mint machine I can ping 10.14.82.1 and 10.14.82.2 but nothing on any other network and I can't browse the Internet if I connect the wire from eth1 on Ubuntu to WAN port on Linksys. However, when I connect both Ubunut and Mint machines to LAN ports on the Linksys I can ping 192.168.1.100, eth0 on Ubuntu, but I can't ping anything beyond that. I assume that the best way to use the Linksys is as a switch and connect only to LAN ports but seem to have trouble crossing from eth1 to eth0 on the Unbutu machine if it is connected to the WAN port.
2. I'm using Webmin to do my settings and set the firewall there. Output from iptables -L shows INPUT and FORWARD rules for a network 192.168.122.0/24 and shows no entries for 10.14.82.0 or 192.168.1.0 networks despite reboot several times and clicking the "Apply Configuration" button on Webmin. I'm suspicious that this is the root of my problem but am unable to figure out how to correct it.
3. Another problem about which I'm suspicious is DNS but I think it should work using Google's public DNS set on the DHCP as above.

I would greatly appreciate anyone's help in how to debug and/or solve these problems or any other information that you have.
 
Old 03-16-2014, 01:05 AM   #2
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875
If you're crossing network types like ethernet to wireless you might want to put each on it's own subnet. Otherwise you'll need iptables the NAT the IP and ebtables the NAT the MAC address as routing is a bit more strict / quirky these days. And for me at least bridging (not in a vm) stopped working between 2.6.32 and 2.6.34 kernels. Also keep in mind that something new is in the works and iptables might be deprecated in the not so distant future.
 
Old 03-16-2014, 12:55 PM   #3
randdeveloper
Member
 
Registered: Jun 2013
Distribution: linux mint xfce
Posts: 42

Original Poster
Rep: Reputation: Disabled
I'm crossing between two wired subnets. I don't understand ebtables at all.
.....
side note: the 192.168.122.0/24 network is actual a virtual network that I'm not using at the moment. My ACCEPT eth1 (LAN) to eth0 (WAN) and only accept established eth0 (WAN) to eth1 (LAN) rules are still in effect.
 
Old 03-21-2014, 12:56 AM   #4
randdeveloper
Member
 
Registered: Jun 2013
Distribution: linux mint xfce
Posts: 42

Original Poster
Rep: Reputation: Disabled
linux as router/gateway unable to route LAN to WAN

it turned out I was using physical interface rather than interface in wemin so my routing wasn't working.
I was hoping for more help in how to debug this issue. I realize it's an old concept making linux into a router but I thought a more complete discussion could come out of this thread. I am new to linux and am obviously in over my head.
thanks anyway. I'll close this thread
 
Old 03-22-2014, 12:18 AM   #5
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875
More complete?

$ man route
$ man netstat

$ man ifconfig
$ man iwconfig

$ man iptables
$ man ebtables

Lot's of NAG howto stuff out there. Network administration guide stuff. Networking is basically 3 parts. An interface with settings. Routing to tell communication requests where to go. And a firewall to prevent things unwanted from happening and sending the things wanted on their merry way. Sure it's a lot more complex than it needs to be, but that's the basic jist of it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Linux as multi-WAN gateway/router. Problem routing traffic through the right NICs. BodaZsombor Linux - Networking 1 10-20-2012 09:42 AM
Assigning default route/gateway for Linux box w/ 2 NIC's - One LAN; One WAN n9nu Linux - Networking 4 02-26-2010 10:40 PM
dhclient not setting default gateway - no WAN route kadissie Linux - Networking 2 03-10-2005 05:55 AM
Routing LAN -> WAN -> LAN with unhelpful router synx13 Linux - Networking 2 06-14-2004 03:35 PM
route traffic onto the net from a lan gateway ulto Linux - Networking 1 04-13-2004 09:54 PM

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

All times are GMT -5. The time now is 03:27 PM.

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