Help with route with several networks.

Issues related to configuring your network
Post Reply
blaquicat
Posts: 2
Joined: 2018/03/28 18:39:33

Help with route with several networks.

Post by blaquicat » 2018/03/28 18:47:33

Hello..

Dont even know how to start, well, i got an CentOS running (6.3 if i recall right)
It has two network interfaces, one connected to an internal link (eth0-172.17.51.9) and (eth1-200.247.200.144)

Theres a nagios fully functional monitoring more than 200 hosts+services.
Those hosts and services vary from 172.17.1.0 to 172.17.255.0 and 10.10.1.0 to 10.10.255.0 (just example)
My question is, can i make a route to redirect any network starting with 172.17, without the need to mention every single one of them?

Manually doing, works.. but will be best if i could put all those networks on two lines (one for 10.10 and another for 172.17)
10.10.7.0 172.17.50.254 255.255.255.0 UG 0 0 0 eth0
10.10.5.0 172.17.50.254 255.255.255.0 UG 0 0 0 eth0
172.17.4.0 172.17.50.254 255.255.255.0 UG 0 0 0 eth0
172.17.71.0 172.17.50.254 255.255.255.0 UG 0 0 0 eth0
172.17.51.0 * 255.255.255.0 U 0 0 0 eth0
172.17.50.0 * 255.255.255.0 U 0 0 0 eth0
172.17.49.0 * 255.255.255.0 U 0 0 0 eth0
Sorry my bad english..

Btw, i cant put eth0 as default gw since theres a squid (not working yet) on this machine aswell.

Whoever
Posts: 1024
Joined: 2013/09/06 03:12:10

Re: Help with route with several networks.

Post by Whoever » 2018/03/29 03:02:20

You need to use /16 netmasks. Instead of 255.255.255.0, use 255.255.0.0

Code: Select all

ipcalc 172.17.4.0/16
Address:   172.17.4.0           10101100.00010001. 00000100.00000000
Netmask:   255.255.0.0 = 16     11111111.11111111. 00000000.00000000
Wildcard:  0.0.255.255          00000000.00000000. 11111111.11111111
=>
Network:   172.17.0.0/16        10101100.00010001. 00000000.00000000
HostMin:   172.17.0.1           10101100.00010001. 00000000.00000001
HostMax:   172.17.255.254       10101100.00010001. 11111111.11111110
Broadcast: 172.17.255.255       10101100.00010001. 11111111.11111111
Hosts/Net: 65534                 Class B, Private Internet
But first, bring that system up to date, you are missing years of security updates.

blaquicat
Posts: 2
Joined: 2018/03/28 18:39:33

Re: Help with route with several networks.

Post by blaquicat » 2018/04/02 11:16:41

Woa, worked.. thanks dude..

Whenever possible gonna update this machine, at first it was just a test..

Thanks again.

Post Reply