-2

I am not a networking guy, so apologies in advance.

I have a small Linux (Ubuntu) box with 2 ethernet ports.

  • eth2 is connected to a cable modem that gives it a 192.168.1.x address + internet connection
  • eth3 I plug directly into, I was able to install isc-dhcp-server and configure it (config below). I am able to plugin a Windows laptop and get an IP in the 10.0.0.x range as configured.

How the heck do I get eth3 seeing the internet (like eth2 already does)? I'd like to be able to plugin a Windows laptop or an access point to eth3 and have it get an internet connection automatically.

I've tried pinging from eth3 and eth2 out to google.com and the results:

ping -I **eth3** google.com => destination host unreachable

ping -I **eth2** google.com => works!

Here is my config:

nano -w /etc/dhcp/dhcpd.conf

ddns-updates off;
option domain-name "example.local";
option domain-name-servers 8.8.8.8;
authoritative;

subnet 10.0.0.0 netmask 255.255.255.0 {
        interface eth3;
        default-lease-time 6000;
        max-lease-time 7200;
        range 10.0.0.100 10.0.0.200;
        option subnet-mask 255.255.255.0;
        option routers 10.0.0.254;
        option broadcast-address 10.0.0.255;
        option domain-name-servers 8.8.8.8;
}

nano -w /etc/default/isc-dhcp-server

INTERFACES="eth3"

nano -w /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eth3
iface eth3 inet static
  address 10.0.0.200
  gateway 10.0.0.1
  netmask 255.255.255.0
  dns-nameservers 8.8.8.8

I have tried port forwarding:

sudo sysctl net/ipv4/ip_forward=1

Also tried bridging, but it kicks me out of the box as soon as I hit enter:

brctl addbr br0
brctl addif br0 eth2 eth3

Any advice or help would be appreciated. I've spent a good 8 hours fumbling through this and feel like an idiot!

Thanks!

1
  • Unexplained downvote compensated
    – peterh
    Aug 10, 2014 at 9:08

1 Answer 1

2

You will need to either tell the default gateway on the network eth2 is connected to that 10.0.0.0/24 is behind that router by specifying a default route (i.e. on your cable modem which is apparently acting as a router also), or use source NAT on traffic outbound on eth2.

Double NAT is inadvisable and so if you are doing that you should find some way to get an internet-routeable IP on the router's internet-facing interface eth2.

The problem is that you have a broken return path; the traffic coming back to 10.0.0.0/24 is not routeable because 10.0.0.0/24 isn't routeable from the segment with the cable modem on it.

A bridge is not what you want here. Bridges are layer 2 things.

2
  • Sorry, but can you please clarify. I'm sill unclear. Do I need to figure out how to set the routes like @ thegeekstuff.com/2012/04/route-examples or do you mean something else?
    – Harry
    Aug 11, 2014 at 3:12
  • All you need to do is set a route on the device 10.0.0.1 is using as a gateway, so it knows where 10.0.0.0/24 is. Aug 11, 2014 at 7:28

Not the answer you're looking for? Browse other questions tagged .