[Solv] Routing? Arch as a router with DHCP gateway interface

This forum is for discussion about general software issues.

[Solv] Routing? Arch as a router with DHCP gateway interface

Postby technosf » Sun Dec 21, 2014 12:26 am

I've been wrestling with setting up routing on an Arch box router with little success, and now I find my brain is full :shock: and I need advice.

The router uses systemd-networkd and dnsmasq (caching on 127.0.0.1) and has three interfaces, eth0, eth1 and wlan0. eth0 is the external interface and configured using DHCP from external router outside (currently assigned 192.168.128.1). eth1 and wlan0 are the internal interfaces, and I'm using a 8 segment class C network (198.162.0.0/27). Once I get basic routing working, I'll turn on NATing using UFW.

I'm stuck even trying to get basic routing working, that is, pinging eth0 from eth1 (ping -I eth1 192.168.0.1) where I've also assigned eth0 a static internal ip using the eth0.network config:

$this->bbcode_second_pass_code('', '[Match]
Name=eth0

[Network]
DHCP=v4

[Address]
Address=192.168.0.1/27')

and eth1.network config:

$this->bbcode_second_pass_code('', '[Match]
Name=eth1

[Network]
DNS=127.0.0.1

[Address]
Address=192.168.0.33/27')

Route tells me:

$this->bbcode_second_pass_code('', 'Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default outside 0.0.0.0 UG 1024 0 0 eth0
192.168.0.0 * 255.255.255.224 U 0 0 0 eth0
192.168.0.32 * 255.255.255.224 U 0 0 0 eth1
192.168.128.0 * 255.255.255.0 U 0 0 0 eth0
outside * 255.255.255.255 UH 1024 0 0 eth0
')
IP forwarding is on:

$this->bbcode_second_pass_code('', 'net/ipv4/ip_forward=1')

Any help would be appreciated!
Last edited by technosf on Wed Dec 31, 2014 11:19 pm, edited 1 time in total.
[size=85] MochaBin 5G || NSA325 [/size]
technosf
 
Posts: 147
Joined: Sat Jan 08, 2011 10:54 pm

Re: Routing? Arch as a router with DHCP gateway interface

Postby WarheadsSE » Sun Dec 21, 2014 4:04 pm

Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Routing? Arch as a router with DHCP gateway interface

Postby pepedog » Sun Dec 21, 2014 4:56 pm

pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Routing? Arch as a router with DHCP gateway interface

Postby technosf » Sun Dec 28, 2014 1:05 am

The potential complications (UFW/IPTABLES and hostapd) are not turned on.

I'm doing initial testing on basic connectivity from a wired client connected to eth1 with eth0 connected to the internet.

The client picks up an ip (lets say 192.168.0.50) and routes:
$this->bbcode_second_pass_code('', 'default 192.168.0.33 0.0.0.0 UG eth0
192.168.0.32 * 255.255.255.224 U eth0')

I can ping the local ip on eth0 192.168.0.1 from the client 192.168.0.50, I can ping the external ip on eth0 (lets say thats 10.0.0.2), but can't get any further. For example, the external router (10.0.0.1) is not reachable.

How do I route a dynamic client past the internal IP on the external interface?
[size=85] MochaBin 5G || NSA325 [/size]
technosf
 
Posts: 147
Joined: Sat Jan 08, 2011 10:54 pm

[Solved] Routing? Arch as a router with DHCP gateway interfa

Postby technosf » Wed Dec 31, 2014 11:18 pm

This was my brain fart. Testing this out behind my current router, I had the very similar Class-C subnets and, seeing the different subnets act differently, I blanked that Class-C's are non-routable addresses and that I needed the NAT to get my test Class-C addresses out through the external interface via masquerading.

Setting up UFW (et al) correctly and things now work.

Thank you for your interest!
[size=85] MochaBin 5G || NSA325 [/size]
technosf
 
Posts: 147
Joined: Sat Jan 08, 2011 10:54 pm


Return to General

Who is online

Users browsing this forum: No registered users and 56 guests