0

I own an Archer D7 modem. I have recently switched from DSL to FTTH, so my ISP provided me with their own ONT (Huawei HG8245Q) with phone, Ethernet and Wifi ports (like if Wifi was a "port" ever). I have a Raspberry Pi that works as VPN gateway to a remote site.

With old setup, D7 (which I bought because of this) had static route to Raspberry, and forwarded the rest to the DSL port. The fiber modem allows me to disable DHCP if I like, but doesn't allow me to modify routing tables: the linked article is for a modem without final Q.

Currently I succeeded in disabling ONT DHCP, put D7 in same LAN as every device and enabled DHCP on it. However I had to tell D7 to use ONT as default gateway. Internet works. While the D7 has the routing information, no client will ever go to it to address the remote VLAN (I'd have to tell my phone a routing table).

I thought I could input a static route "0.0.0.0/0.0.0.0" into the D7 through the ONT LAN address and keep remote VLAN via Raspberry LAN address, but D7 refuses 0.0.0.0 to override the default route.+

This article shows that with D7 you can configure a static default gateway, but my control panel doesn't look that. The default gateway can only be a WAN interface in my case

I know I can use LAN1 port as WAN port and put D7 behind ONT, so that I have two levels of NAT. That is the answer if I don't find another way.

But I wanted to ask: how do I specify a static route on a D7 router to a device on my LAN? It will be very useful to divert guest network traffic via Raspberry Tor :-)

  • I understand that sometimes I overcomplicate the whole my life, but I just like to do complicated stuff – usr-local-ΕΨΗΕΛΩΝ May 26 '17 at 17:03
  • Static routes need not be default routes. Changing the default route from the WAN connection will disable your Internet access. You must apply a static route to a router (layer-3) interface, not an interface that is part of a switch (layer-2) in the router. – Ron Maupin May 26 '17 at 17:15
0

If possible, just add specific routes for your VLANs. You probably still want the ONT to be used as a gateway for the public Internet – so there are just three 'private' ranges to cover.

NETWORK         NETMASK
10.0.0.0/8      255.0.0.0
172.16.0.0/12   255.240.0.0
192.168.0.0/16  255.255.0.0

But let's say you really want to override the default gateway for every single thing.

The most specific route will be used, so a common trick is to divide the internet into two routes: 0.0.0.0/1 and 128.0.0.0/1. While somewhat ugly, this will always take priority over the "default" 0.0.0.0/0 route.

NETWORK         NETMASK
0.0.0.0/1       128.0.0.0
128.0.0.0/1     128.0.0.0

If tnat's not accepted by your router, start at 1.0.0.0 instead (luckily 0.0.0.0/8 doesn't actually contain valid IP addresses so it can be omitted) – these will cover the whole lot:

NETWORK         NETMASK
1.0.0.0/8       255.0.0.0
2.0.0.0/7       254.0.0.0
4.0.0.0/6       252.0.0.0
8.0.0.0/5       248.0.0.0
16.0.0.0/4      240.0.0.0
32.0.0.0/3      224.0.0.0
64.0.0.0/2      192.0.0.0
128.0.0.0/1     128.0.0.0

If that's still not accepted by your router, spam it with /8 routes which cover everything from 1.0.0.0 to 255.255.255.255:

NETWORK         NETMASK
1.0.0.0/8       255.0.0.0
2.0.0.0/8       255.0.0.0
3.0.0.0/8       255.0.0.0
[...]
221.0.0.0/8     255.0.0.0
222.0.0.0/8     255.0.0.0
223.0.0.0/8     255.0.0.0

(Skip 127, that's loopback. You can stop before 224, that's where the multicast range starts.)

And if that doesn't work, then I'm sorry to inform you but your router is garbage.

  • The router is clever, won't accept 0.0.0.0 :-) – usr-local-ΕΨΗΕΛΩΝ May 27 '17 at 0:31
  • Then it should accept 1.0.0.0. See updated post. – user1686 May 27 '17 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.