Internet not working. sharing from linux computer via ethernet
Joseph Turco (5563) 22 posts |
Hello all, I decided to switch over to risc os on my raspberry pi 400. I am trying to configure internet. what i have done is the following on my linux machine: https://medium.com/@TarunChinmai/sharing-internet-connection-from-a-linux-machine-over-ethernet-a5cbbd775a4f The gateway on the linux machine is 192.168.0.110 on the ethernet interface, with a ip subnet of 192.168.0.0/16 (as per the guide, but just used my own ips).on the risc machine, i have set the ip to 192.168.0.2, the gateway to 192.168.0.110, and have set the name servers to 8.8.8.8 and 8.8.4.4. from the linux machine, i am able to ping that address set on the risc machine. In netsurf i am getting a connection timed out error whenever i goto a webpage. what am i doing wrong? |
Stuart Painting (5389) 714 posts |
It is unusual to set up 192.168.0.0 as a /16: it’s far more common to split it into multiple /24 subnets. It’s not wrong to use a /16: it’s just unusual. Things to check:
|
Joseph Turco (5563) 22 posts |
hey Stuart thanks for the response. I changed the subnet mask as per your instructions, and i am still getting a request timed out. the name servers are set to 8.8.8.8 and 8.8.4.4 with “try name server too” checked off. I feel like something on the linux box is not configured correctly. I wish i could afford one of thoese wifi to ethernet bridges that people use on here, but all i have is a old linux workstation to use. |
Steve Pampling (1551) 8172 posts |
Diagram shows: In your setup, I assume you are setting the Pi with an address of 192.168.122.11 subnet 255.255.255.0 to match the laptop ether interface and a gateway address on the Pi of 192.168.122.10 Pi and ether interface on laptop can then ping each other and, provided the forwarding is set correctly in the laptop you should be able to ping to 192.168.0.1 through the laptop. |
Joseph Turco (5563) 22 posts |
I think i am over my head with this. Im new to RISC OS so im not well versed on the internal workings of the network interface. I can ping the pi from the linux machine that i am trying to share the connection with, but the pi wont ping anything at all. might there be a guide someone has used that works setting up a linux machine to share the connection? I wish i could just plug the damn thing right into the router, but the wife doesn’t want my desk beside the router (sigh)…. |
David J. Ruck (33) 1636 posts |
Are the subnet masks the same on all machines? |
Chris Gransden (337) 1207 posts |
Have you tried plugging the pi directly into the router. That will confirm the RISC OS networking is working at least, |
Paolo Fabio Zaino (28) 1882 posts |
I would start simple here:
If all the tests above succeed then it’s most likely a problem with your Linux gateway not forwarding traffic outside. Google DNS IPs are obviously external and so you need to ensure traffic is being routed outside. This should be done by configuring Linux IP Forwarding and the correct NAT policies in IPTables or Firewalld or fwu (depending on which one is being used on your Linux distribution as a front-end to manage IPTables policies). If one of the tests above fails please post the messages here from your TaskWindow. Hope this helps! |
Clive Semmens (2335) 3276 posts |
I solved this one with ethernet-over-the-mains. Don’t remember how much it cost, but it wasn’t terribly expensive. (The Mac shares the connection, which is better than wifi.) |
Joseph Turco (5563) 22 posts |
Hey Pablo, thanks for the response. I’ll try and test the pi with the router when I get a chance to move stuff. On the pi currently, I can ping my own IP, but I cannot ping the gateway. Ifconfig -a says ege0: flags=8843<UP, BROADCAST, RUNNING, SIMPLEX, MULTICAST> MTU 1500 |
David J. Ruck (33) 1636 posts |
You have a netmask indicating a /24 but you mentioned about that you’ve set the Linux machine to a /16. Either make the netmask on RISC OS 255.255.0.0 or preferably change Linux to 192.168.0.0/24 – which is a more standard setup. Just noticed Stuart said exactly the same in the second post. |
Joseph Turco (5563) 22 posts |
David after seeing that i changed it to a /24 and the netmask to 255.255.255.0. before when it was a /16 and had it set to 255.255.0.0 and i still had the problem. |
Dave Higton (1515) 3534 posts |
What is the gateway set to on the Pi? |
Steve Pampling (1551) 8172 posts |
If the Pi gateway isn’t the ether port IP of the Linux machine, with identical subnet mask things won’t work. That’s the first bit to get right and test with ping from both ends to the other. Linux may have a firewall up on the ether port which blocks things. After that – If the other interface of the Linux machine isn’t a different subnet to the subnet of the ether port/Pi then the forwarding of the router function in Linux won’t work |
Paolo Fabio Zaino (28) 1882 posts |
@ Joseph Druck noticed well, your RISC OS appears to have a netmask configured /24 (not /16 as you’ve mentioned). But this shouldn’t cause issues, the router has a larger netwmask but they should be able to reach eachother. So, given that you can’t ping the gateway from RISC OS, but you seems to be able to ping RISC OS from the gateway, it seems that the issue might be on the gateway. Let me explain: If you have configured the gateway with a /16 and it has 2 interfaces with a traditional private class C like 192.168.0.0, then it’s most likely that the router is routing its own responses to another port and they are not being received back from RISC OS. This is because 192.168.4.3 (for example) and 192.168.100.2 with a /16 are considered the same subnet, while with a /24 they would be different subnets. So, I would check on your Linux gateway which networks does it has configured, you can do this by simply run (on your linux terminal) ip route show Another useful command to understand where the gateway is sending its own packets is: arp -a This will show you where the gateway has identified the packets coming from which MAC Address, you can verify the MAC is the correct one with the output you had before on RISC OS from "ifconfig -a " for the ege0. please post the results here. So we can understand a bit more of what’s happening with your gateway. Thanks |
Joseph Turco (5563) 22 posts |
Thanks for the help everyone. I was able to get a long ethernet cord from my father, and plugged the device into the router. I enabled DHCP and added the routers gateway to the pi, and successfully have internet access. One thing that is odd, is that at boot time, a pop-up shows up saying “boot failed, gateway address already exists”, but everything works fine after i close it. Any reason why that would show up? IP address is 192.168.0.110, subnet mask is 255.255.255.0, and gateway is 192.168.0.1. |
Dave Higton (1515) 3534 posts |
If you have DHCP enabled, you should leave the Gateway entry blank. The Gateway field should be filled in if you’re not using DHCP. |
Joseph Turco (5563) 22 posts |
Makes sense Dave, thanks for the help, sorry for my ignorance, i am a total noob when it comes to RISC OS. I plan on buying the user guide once im able to afford it and learn the in’s and out’s of the system in full. |
David J. Ruck (33) 1636 posts |
Don’t worry, that one catches everyone out. |
Paolo Fabio Zaino (28) 1882 posts |
btw looking at the IPs assigned by your actual gateway: 192.168.0.110 It’s certain that your Linux “gateway” in the middle was sending its responses to the port connected to the actual gateway, not to the port that was connected to your RISC OS device. 192.168.0.x not only is the same subnet in a /16, but it’s actually the exact same subnet you tried to use on the other segment (the one between your Linux gateway and RISC OS). This would never have worked, JFYI. Glad to see you’re up and running now with your RISC OS device, enjoy! :) |
Dave Higton (1515) 3534 posts |
It catches so many people out that we really ought to think about a fix. It would be simple, wouldn’t it, to grey out the Gateway icon if DHCP has been selected, and not attempt to specify a gateway? Please correct me if I’m wrong. And Joseph: in respect of DHCP or Gateway (but not both), RISC OS is no different from other OS. Perhaps less tolerant of setup errors. Network setup requires the same information regardless of OS. |
Steve Pampling (1551) 8172 posts |
It would match normal behaviour in other implementations
The idea is correct, how easy it would be to implement I don’t know, but hopefully it is part of the network stack/config rewrite. |
Chris Mahoney (1684) 2165 posts |
It’s not quite as simple as “just grey out the field” because then if someone’s previously entered a value in there then they won’t be able to remove it again. Meanwhile you also don’t want to automatically clear the field, because then if the user accidentally enables DHCP and hasn’t made a note of the previous gateway setting, then they’ll lose it. |
Clive Semmens (2335) 3276 posts |
Could you put an asterisk or something at the start of the field rather than clearing it, and then ignore a gateway that started with an asterisk? (I don’t know how the field is stored – away from home and on the Mac, so can’t check – if anything other than all nulls is meaningful, you might need another bit somewhere to say “ignore”.) Or just automatically ignore the Gateway setting if DHCP is on… |
Rick Murray (539) 13850 posts |
That’s not their job. What’s the point in having a tool that cannot do the setup correctly?
Tant pis. That’s not the computer’s job. Simply grey out the field, and if the user makes a mistake by clicking the wrong icon, then clicking a different icon will active it again with the information retained When clicking on the Save/Update icon, then throw away the unnecessary data (like gateway and IP address if using DHCP). This is not a mere “mistake”, this is a deliberate user action therefore there’s no justification to retain anything “just in case”. That’s how, if I remember correctly, XP does it. It’s the acceptance of the given settings that determines what is retained or discarded.
I find it astonishing that it doesn’t… |