0

So, I / we have brand new Fedora Core 28 installation we've been trying to bring online. The installation went perfectly so far as we could tell. It has two network cards, one for an internal net, one with a fixed IP address. It's a server, so its primary job is to run a web server, httpd. And it has to be accessible from other than the console, so it's running sshd.

At first, everything seems OK. The first net use was to use yum to install many packages, there was no problem. We added gnome to get a GUI, added firefox to get a web browser and then used that to help get data for troubleshooting. Connections on the inner net are fine. Connecting with SSH is not a problem and at least one account was set up to use encryption keys to avoid a password. Connecting to the new web server seems fine too, using both internal and external IPs. So, we felt we had confirmed the ssh and web server were configured properly. ...Initially, we didn't know anything was wrong.

When we got around to connecting from the outside world is when things "went sideways." Attempts to connect with SSH just failed outright and connections to the web server also appeared to fail outright as well.

FIRST attempt was with the firewall. How's it configured? Is it iptables or firewalld? How do we ensure we can get through from the outside? We found that somehow we'd configured the exception in /etc/firewalld/zones - the default zone is "FedoraServer.xml" in our case - as httpd, and we noticed on a reboot that it complained about that and changed it to http, with which we no longer noticed any complaint. Still no joy.

Then there's nmap! This is a port scanner for Linux systems to look at any network target's open ports. This seemed to show we were not blocked by the firewall. We confirmed iptables was not in use and it was firewalld, so we turned it off and still no joy.

Then we considered the older equipment. Twisted pair ethernet ports are bi-directional devices so was it possible inbound on the exterior port was good while outbound was bad? OR, maybe, there was a bad port on the switch? So, we tried swapping them, internal and external. No change.

We then considered that MAYBE the router was filtering, even though it shouldn't. The new box was a replacement for an older box that was retired, and the old one was fully functional, but who knows? Maybe the router has gone crazy? So, we went to log into it and see. But, unfortunately, nobody could find the router's password.

Instead, since the router only knows the systems by their external IPs, we shut down a fully-functional system and had the new one pick up the shut-down system's IP address. This eliminates the router as a potential cause, at least we thought so. However, the problems persisted.

It was suggested that maybe the router is at fault as perhaps it was grabbing MAC addresses, and so to eliminate that possibility, we rebooted it. Again, no improvement.

I then had the insight to ask our external tester to please increase the verbosity of ssh connection diagnostic data by adding, increasingly, -v to the command line (you can do up to three), and our internal sys-admin to please check the Apache logs. And this was very helpful. We found that the external perception was ssh was getting to our sshd daemon but the connections were being dropped and also the web server logs were showing correct inbound connections from just the places we expected, and logging "200" as the result, which means httpd thought the web clients were getting their pages. But it wasn't true.

OK, so now what?

2
  • Port forwarding at the router is something you can't avoid. If it's not set yet then you need the password to change its settings, of course. You say the old one was working? That means one of two possibilities, (1) it was already configured; or (2) it wasn't a router (e.g. old cable-modems connect directly so the firewall is your only concern; a router, by definition, shouldn't allow that unless configured).
    – user931000
    Aug 27, 2018 at 2:15
  • @GabrielaGarcia Thanks for the reply, and we considered what you're addressing in your comment. This is exactly why we swapped the server's IP address, so the router wouldn't know the difference and we restarted it to ensure it wasn't caching MAC addresses. But, we found the issue, as described below. I posted this to help reduce the number of people who waste time as we did!
    – Richard T
    Aug 27, 2018 at 2:38

1 Answer 1

0

After great agony, as documented above, I felt a thorough, pedantically detailed survey was in order, and it was done. We found the solution, and it was exceptionally simple!

It's important to understand that several long-time experts with more than 30 years in the field each missed this!

The cause was simply that the default route on the box had a one character flaw; it was addressing the router, but the wrong one of the two IP addresses the router responds to! One address is for manipulating the router via a port 80 connection and the other is for routing outbound traffic.

It's helpful to remember that inbound connections are good until some certain point when the return effort switches focus, and then, when the response is initiated from the inside and not outside, the route has to be correct, and it wasn't. This is why it failed.

I'm not entirely sure why the outbound-initiated connections worked as well as they did but a reasonable guess is that the router realized the packets it was getting on the wrong IP address were still headed outbound and routed accordingly. Hmmm. Input on that is appreciated.

Simply, just because you're talking to the router doesn't mean you have the outbound route address correctly! At least, this was true for us.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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