Page 1 of 3

How to connect 2 networks with one router

Posted: Thu Jun 18, 2015 2:40 pm
by Jessuzz94
Sorry with the questions but it has relation with nagios because i want to probe if nagios can monitor one device for diferent network :c



i have one router, one switch and 2 devices, (pc with nagios in ubuntu server and one laptop)

how can configure the router and switch to see the nagios pc and mi laptop, nagios have the 192.168.1.10 and my lap 192.168.2.10i.

I tried to configure route on a stick and it doesnt work, only in packet tracer but in real test not.

Re: How to connect 2 networks with one router

Posted: Thu Jun 18, 2015 2:47 pm
by jolson
Please be more specific as to how your network is designed. Are the laptop and Nagios on opposite sides of the router? It sounds like you might be using VLANs to traverse your router - in that case, as long as you have appropriate trunking and routing in place, Nagios shouldn't have a problem traversing subnets.

Re: How to connect 2 networks with one router

Posted: Thu Jun 18, 2015 2:54 pm
by Jessuzz94
No, they are close, i am testing and all are conected to the switch, this is i configure:

nagios pc: 192.168.1.10
laptop: 192.168.2.248

in the switch:

interface fa0/3 : switchport mode trunk

in the router:

interface fa0/0.10:
encapsulation dot1q 10
ip address 192.168.1.254

interface fa0/0.20:
encapsulation dot1q 20
ip address 192.168.2.254

interface fa0/0:
no shutdown


i connected the nagios pc to the fa0/8 of the switch and laptop to the fa0/11

in the switch i declared :

interface fa0/8
switchport access vlan 10

interface fa0/11
switchport access vlan 20

Re: How to connect 2 networks with one router

Posted: Thu Jun 18, 2015 3:03 pm
by jolson
Keeping in mind that this is more of a Cisco based question and less of a Nagios question, can your nagios device ping your laptop? If not, there are a few things that come to mind.

Code: Select all

ip address 192.168.1.254 255.255.255.0
ip address 192.168.2.254 255.255.255.0
Supply the subnet mask as well as the IP address of the router subinterfaces.

Your switch also needs dot1q turned on.

Code: Select all

configure terminal
interface interface fa0/3
switchport trunk encapsulation dot1q
switchport mode trunk
If you're still having problems with the above, consult someone else on your team - unfortunately we can't spend a lot of time troubleshooting Cisco IOS.

Re: How to connect 2 networks with one router

Posted: Thu Jun 18, 2015 3:28 pm
by Jessuzz94
switchport trunk encapsulation dot1q

this command works.

now i can enter to the nagios web interface from my laptop (can ping from 192.168.2.248 to 192.168.1.10)

but i can ping from nagios server to other devices that i had monitoring, including my lalptop, whats going on?

Thanks, if you can anser me just this issue please, i understand that its more cisco and route troubleshooting

Re: How to connect 2 networks with one router

Posted: Thu Jun 18, 2015 3:31 pm
by jolson
but i can ping from nagios server to other devices that i had monitoring, including my lalptop, whats going on?
You can or cannot? Is the default gateway of Nagios set to the routers appropriate subinterface?

Re: How to connect 2 networks with one router

Posted: Thu Jun 18, 2015 3:48 pm
by Jessuzz94
sorry, can´t.

nagios has the 192.168.1.254 gateway. i think that is correct

Re: How to connect 2 networks with one router

Posted: Thu Jun 18, 2015 3:51 pm
by jolson
Looks correct. Maybe give us a 'show run' to work with?

Also, does the nagios server have a /24 netmask?

What happens if you run this from the Nagios CLI:

Code: Select all

ping 192.168.1.254
ping 192.168.2.254
ping 192.168.2.248

Re: How to connect 2 networks with one router

Posted: Thu Jun 18, 2015 3:56 pm
by Jessuzz94
yeah all ip´s are /24

i can ping to 192.168.1.254 and can´t ping to 192.168.2.248

Re: How to connect 2 networks with one router

Posted: Thu Jun 18, 2015 3:57 pm
by jolson