Jump to content

Apache server not working with 2 routers

MisterWhite

I've searched online for solution but nothing helped.

The first router is the one distributing internet to all other devices (including the second router). First router is in the main room and second one is in my room. (we have many internet dependent devices, that's why two routers).

If i disconnect the second router and apply port forwarding on the first one everything works and other people can access the server, though when the two are connected the mastershit begins.

First router: Lan IP: 192.168.11.1

Second: Lan IP 192.168.0.1

i5-4690k, R9 380 4gb, 8gb-1600MHz ram, corsair vs 550w, astrock h97m anniversary.

 

Link to comment
Share on other sites

Link to post
Share on other sites

What routers are we talking about? Have you put trunks between them with static routes?

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Windspeed36 said:

What routers are we talking about? Have you put trunks between them with static routes?

Well they both can provide Wi-Fi. Not really an expert on routers and what kinds there are.

i5-4690k, R9 380 4gb, 8gb-1600MHz ram, corsair vs 550w, astrock h97m anniversary.

 

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, MisterWhite said:

Well they both can provide Wi-Fi. Not really an expert on routers and what kinds there are.

Right, chances are they don't have the functionality required to add static routes to each router.

 

what is currently going on is say you've got a client A 192.168.1.10 on R1 192.168.1.1 destined for client B 192.168.2.10 on R2 192.168.2.1. The packets from A will hit R1, it will look up in its routing table for 192.168.2.1 however it won't know of it and immediately drop the packets as it is also not destined for WAN. 

 

What at adding static routes does is tells R1 that it can forward all traffic for 192.168.2.1/24 to R2. You'd also need to add a rule on R2 to forward all traffic for 192.168.1.1/24 to R1

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, Windspeed36 said:

Right, chances are they don't have the functionality required to add static routes to each router.

On R1 under advanced routing is static routing

and on R2 under routing settings is static routing too (not sure if you were talking about this, just spotted "static")

i5-4690k, R9 380 4gb, 8gb-1600MHz ram, corsair vs 550w, astrock h97m anniversary.

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, MisterWhite said:

On R1 under advanced routing is static routing

and on R2 under routing settings is static routing too (not sure if you were talking about this, just spotted "static")

That may do it - what is happening is that the packets from A are going to R1 and are destined for client B. R1 has addresses and physical ports for WAN, A and C as well as R2 however it doesn't have an entry for B. What it needs is to be told that client B can be found on R2. Likewise if you had the reverse, R2 needs to know what WAN as well as 192.168.1.1/24 is found on R1. 

 

That make sense? 

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, Windspeed36 said:

That make sense? 

Kind of get it, but not sure what exactly to type. I'll add two fotos

R1.png

R2.png

i5-4690k, R9 380 4gb, 8gb-1600MHz ram, corsair vs 550w, astrock h97m anniversary.

 

Link to comment
Share on other sites

Link to post
Share on other sites

R1:

Route set number is probably fine as it is.

Route name is whatever you like, something describing what the static route does works.

Metric can be left to 0 or 1 or whatever, it determines how much the route "costs" in terms of shorter path to target costs less than longer. As you have only one path to target, doesn't matter how much metric it is since it gets chosen no matter what.

Destination LAN net would be  192.168.0.0 (I'm assuming that R1 is the first router and R2 is second from the original post).

Subnet mask is 255.255.255.0

Gateway is 192.168.0.1

Interface I'm not quite so sure since we don't see what's under it, but it's connected via LAN port so I'd say you choose LAN if that's an option. LAN & WLAN might work also.

 

R2:

Destination network IP address is 192.168.11.0

Subnet mask is 255.255.255.0

Gateway is 192.168.11.1

 

 

However, the way I see it your R2 router's default gateway is already 192.168.11.1 so all packets are routed that way no matter what.

So first try to set the static route only on R1, and only if that doesn't do it, make the static route to R2.

Link to comment
Share on other sites

Link to post
Share on other sites

59 minutes ago, U.Ho said:

R1:

Route set number is probably fine as it is.

Route name is whatever you like, something describing what the static route does works.

Metric can be left to 0 or 1 or whatever, it determines how much the route "costs" in terms of shorter path to target costs less than longer. As you have only one path to target, doesn't matter how much metric it is since it gets chosen no matter what.

Destination LAN net would be  192.168.0.0 (I'm assuming that R1 is the first router and R2 is second from the original post).

Subnet mask is 255.255.255.0

Gateway is 192.168.0.1

Interface I'm not quite so sure since we don't see what's under it, but it's connected via LAN port so I'd say you choose LAN if that's an option. LAN & WLAN might work also.

 

R2:

Destination network IP address is 192.168.11.0

Subnet mask is 255.255.255.0

Gateway is 192.168.11.1

 

 

However, the way I see it your R2 router's default gateway is already 192.168.11.1 so all packets are routed that way no matter what.

So first try to set the static route only on R1, and only if that doesn't do it, make the static route to R2.

On R1, gateway to R2's network should be R2's WAN IP that it gets from R1, i.e. 192.168.11.x

 

R2 should not need to be told how to route packets to R1's network, since it's WAN interface is already in that network (I'm just agreeing with your thought about the default gateway)

 

This would be easier overall if one of the routers (whichever is not connected to the modem) was just set to AP mode.

 

EDIT: The interface selected in R1 should be left as it is, assuming that R1 is the router connected to the modem/internet, and not R2

 

P.S. R1 is definitely running dd-wrt.

Looking to buy GTX690, other multi-GPU cards, or single-slot graphics cards: 

 

Link to comment
Share on other sites

Link to post
Share on other sites

42 minutes ago, brwainer said:

On R1, gateway to R2's network should be R2's WAN IP that it gets from R1, i.e. 192.168.11.x

 

You're right.

My bad.

 

This could actually be an issue some day, since R2 gets that IP from R1 DHCP server and as such it might not always be the same IP.

In practice, however, it will most likely not pose a problem unless there are long major power outages or R1 has to be replaced or reset to factory defaults.

Link to comment
Share on other sites

Link to post
Share on other sites

If i may from my Experiance you have 2 routers trying to route which is fine when you have devices that support this but if you dont you must have one device doing the routing and the other acting a switch then you set the default gateway of the switch as the same as the router 192.168.0.1. 

 

If you have two default gateways the second router wont connect to anything, so in reality you would need 3 routers one that subnets and the other two that deal with the connections.

 

So the ideal setup would be 

R1 Subnet 192.168.0.1 -> Router 2 -> Switch

      Subnet 192.168.11.1 -> Router 3 -> Switch

 

Hope this makes sense. 

    

With advanced routers you can do this easy with 1 router and 2 switches and a subnet or vlans.

 

If you can show more options that your router has might be able to help more.  or tell us what router your using i might be able to look it up and see how you can set it up right.

Please Quote so i know you have replied. | If we have provided a solution to your problem mark it with answer found.

And also please read the COC and avoid the embarrassment and lecture that will ensue.

Link to comment
Share on other sites

Link to post
Share on other sites

@U.Ho @brwainer Nah, still doesn't work. when i type my WAN IP it still gets me to R1 setting page instead of apache server.Though as I said, unplugging second router removes the problems, and port forwarding works but that is not convenient.

i5-4690k, R9 380 4gb, 8gb-1600MHz ram, corsair vs 550w, astrock h97m anniversary.

 

Link to comment
Share on other sites

Link to post
Share on other sites

12 hours ago, brwainer said:

 

 

11 hours ago, U.Ho said:

 

Nah, still doesn't work. when i type my WAN IP it still gets me to R1 setting page instead of apache server.Though as I said, unplugging second router removes the problems, and port forwarding works but that is not convenient.

i5-4690k, R9 380 4gb, 8gb-1600MHz ram, corsair vs 550w, astrock h97m anniversary.

 

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, MisterWhite said:

@U.Ho @brwainer Nah, still doesn't work. when i type my WAN IP it still gets me to R1 setting page instead of apache server.Though as I said, unplugging second router removes the problems, and port forwarding works but that is not convenient.

Turn off remote HTTP access on R1. You should only be able to access R1's webpage via it's internal IP.

 

 

Looking to buy GTX690, other multi-GPU cards, or single-slot graphics cards: 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Yea, what @brwainer said. Thing is if something in front of the Apache server responds to http queries at the same IP and port, there's nothing getting through to the server.

 

I think the issue might be that the http request comes through the LAN port and not WAN port, so it might not be seen as remote access.

That is if the apache server is supposed to be accessible via a public IP from the same private network where it resides.

Can you reach the apache server via its private address? 

 

 

Thing is, these routers are really not meant to be connected the way you have connected them. The proper way to make a private network is via switches, unless you have certain requirements involving splitting your network in many IP address spaces.

 

I would certainly suggest you get a switch and perhaps a wireless access point to go with it if you need and replace R2 with those.

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, U.Ho said:

Yea, what @brwainer said. Thing is if something in front of the Apache server responds to http queries at the same IP and port, there's nothing getting through to the server.

 

I think the issue might be that the http request comes through the LAN port and not WAN port, so it might not be seen as remote access.

That is if the apache server is supposed to be accessible via a public IP from the same private network where it resides.

Can you reach the apache server via its private address? 

 

 

Thing is, these routers are really not meant to be connected the way you have connected them. The proper way to make a private network is via switches, unless you have certain requirements involving splitting your network in many IP address spaces.

 

I would certainly suggest you get a switch and perhaps a wireless access point to go with it if you need and replace R2 with those.

The proper thing to do would be to change the configuration of the second router to be an AP, as I said a few posts ago

Looking to buy GTX690, other multi-GPU cards, or single-slot graphics cards: 

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, brwainer said:

The proper thing to do would be to change the configuration of the second router to be an AP, as I said a few posts ago

Well if that's an option, sure.

That should functionally be somewhat in par with what I was suggesting anyway, but without any extra hardware.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×