Act as IP Router
Bryan (8467) 468 posts |
I have been experimenting with 5.28 IP routeing. It works as a simple NAT router connected to an Internet modem. I now have it connected to two Internet modems and I have it doing a very simple static route. For example, my routes file has the line This works and traffic to google from all of my computers is routed to Google via the EE mobile modem rather than the ADSL modem. But that seems to be the limit of its capabilities. Adding a second line to the routes file to route BBC traffic to the same EE modem achives nothing. Is that to be expected or am I missing something. Some example files might be nice. |
Stuart Painting (5389) 714 posts |
Let’s have a look.
google.co.uk provides only one IP address, while bbc.co.uk provides 4. “route add” will almost certainly be adding only the first IP address supplied, while the client could be using any of them. Bear in mind that the client will be doing its own DNS lookup, so may see the IP addresses in a different order, or even completely different IP addresses. |
Bryan (8467) 468 posts |
Good point. But …. …. I actually used a different host which I did not want to post on here. And the order seems to matter – only the first line in the routes file seems to be acted upon.I would like to use IP addresses or even ranges instead of the host name, but the Route documentation is not clear about the format, which is why I hoped I might get some examples. |
Steve Pampling (1551) 8170 posts |
Eight for bbc actually, but the first 4 listed are IPv6. Similarly google is two (IPv6 and IPv4) What does |
Bryan (8467) 468 posts |
Stops the Pi 4 from booting – with error message |
Bryan (8467) 468 posts |
However, adding a few more
also work as expected – even the /16 Thank You for that. |
Bryan (8467) 468 posts |
Incidently,
I am seeing a lot more addressees for but I do not have accees to nslookup |
Bryan (8467) 468 posts |
where is the file? |
Stuart Painting (5389) 714 posts |
You will do. Google has many servers spread all around the world, so a degree of load-balancing and/or “closest physical server” will result in different addresses being delivered, albeit one at a time. For example, further upthread I gave an example of looking up google.co.uk on Google’s own public DNS server (which gave an answer of 142.250.187.195). When I retried the same lookup on my ISP’s DNS server, I got a different result (142.250.180.3). This is to be expected.
It’s a confusing error message: I’m almost certain that it should say “route/entry exists” rather than “file exists”. When you’re using DHCP to get a local IP address, the DHCP module will give you a “free” 0.0.0.0/0 route, pointed at the default router for your subnet. This is not a problem while you’re adding more specific routes, but when you attempt “route add” for a network already in its tables, it will generate an error. |
Bryan (8467) 468 posts |
It is all looking good. Thank You, Stuart, et al. |
Bryan (8467) 468 posts |
Files I would would suggest that there are file(s) somewhere which hold the routing tables as these are maintained over a reboot/powercycle.
|
Theo Markettos (89) 919 posts |
I think it’s saved in Choices:Internet, or less likely ! Boot.Resources.! InetDBase. I think it just collects the *route commands you entered in an Obey file. |
Bryan (8467) 468 posts |
I now think that I have been seeing more of a problem than is really there. I can now say that it is all doing what I would like it to do. In two other topics I slso asked for help or comment on USB Ethernet adapters and headless running. I can now say that this headless multi-subnet Pi 4 is working very well. I think the only bit of all of this that will be of general interest is that I now have all of the household 1 Google 2 traffic being routed over a dedicated EE mobile service instead of my FTTC static IP internet service. 1 Windows PCs, Ipads, Smart TVs, etc as well as a few RO desktops. 2 Google, Facebook, Twitter, etc. |