3

So our newly configured servers have uncovered some switch configuration issues.

In /etc/sysctl.conf we have the following:

net.ipv4.conf.all.send_redirects = 0                    # CIS 4.1.2
net.ipv4.conf.default.send_redirects = 0                # CIS 4.1.2
net.ipv4.conf.all.accept_source_route = 0               # CIS 4.2.1
net.ipv4.conf.default.accept_source_route = 0           # CIS 4.2.1
net.ipv4.conf.all.accept_redirects = 0                  # CIS 4.2.2
net.ipv4.conf.default.accept_redirects = 0              # CIS 4.2.2
net.ipv4.conf.all.secure_redirects = 0                  # CIS 4.2.3
net.ipv4.conf.default.secure_redirects = 0              # CIS 4.2.3

This is good because it turns off ICMP redirect and uncovered an incorrectly configured switch.

The relevant switch config is as follows:

configure
vlan database
vlan 10,99,102
vlan routing 102 1
vlan routing 99 2
vlan routing 10 3
exit
hostname "CloudSwitch3"
stack
member 1 1
member 2 1
exit
ip address 10.10.10.12 255.255.255.0
ip routing
ip route 0.0.0.0 0.0.0.0 10.168.102.2
interface vlan 10
routing
ip address 10.10.102.1 255.255.255.0
exit
interface vlan 99
routing
ip address 10.168.99.1 255.255.255.0
exit
interface vlan 102
routing
ip address 10.168.102.1 255.255.255.0
ip rip
ip rip receive version both
exit

My route table is showing as follows:

Network Address Subnet Mask Protocol    Next Hop Interface  Next Hop IP Address
0.0.0.0         0.0.0.0         Default vlan102 10.168.102.2
10.10.102.0     255.255.255.0   Local   vlan10  10.10.102.1
10.168.99.0     255.255.255.0   Local   vlan99  10.168.99.1
10.168.102.0    255.255.255.0   Local   vlan102 10.168.102.1

Now for the issue: My GW is setup to be 10.168.102.1 but the ICMP redirect from the router keeps staying to redirect it to 10.168.102.2 next time. This configuration works for the servers that are configured to accept the redirects, but doesn't for the ones that don't. ( we are experiencing slowness on those )

Why are the 10.168.102.xxx addresses getting told to route through the 10.168.101.2 server when (Local) VLAN 102 says to use 10.168.101.1?

10.168.101.2 is the failover switch.

What is the best way to address the issue?

1 Answer 1

2

This got pretty long so I'm just going to put the answer at the top instead of the bottom, read the whole thing if you want more background and to read a rant.

Fix and summary of the issue

Essentially the problem is that your pointing your default gateway to another device that is still local to the clients as it's default gateway which is causing asymmetric routing and making connection inconsistencies that the applications/hosts probably don't like much. You can turn on redirects on the router interface or the switch but that's still not going to change that you're sending your packets to one device and receiving them from another. To remidiate this you have a couple options:

  1. Segment off those two devices. You generally do not need two separate routing devices in an end network. Keep your transit upstream and keep your LANs clean as this will also help clear chatter that your servers don't need to hear (as much as they love receiving RIP updates)
  2. An exception to this would be to configure the switch and the router to have some sort of first hop redundancy protocol (VRRP,GLBP,HSRP,etc.) the caveat with this is that you would need an identical next hop (or equal cost way to reach the destination) and be sure to specify the master and why it's priority would decrement to ensure traffic paths.

The just of it is that you need to create boundaries in order to segment traffic and control where the decisions to send traffic is being made. How it is now with two possible routing devices, it's leading straight down the road to a lack of security controls and irregular traffic patterns. I would really suggest setting a layer 3 transit up behind the scene to reach between eachother (possibly just take the IP addresses off your switch if the router handle it). That way devices have one exit, and that one exit leads to how everything is going to reach everything else, giving you central control and simplifying troubleshooting.

ANALYSIS AND RCA OF ISSUE FROM GIVEN OUTPUTS Since both the Gateway and the Gateway's next hop are both on the same LAN as your end devices, the redirect is there to let them know they no longer need to forward traffic to them since there is a more direct route available for them to use (even if you don't want them to be using it, a network device will still see it as a better option as it's one less hop the end device would have to take)

This essentially creates local asymmetric routing:

Path out w/o ICMP-REDIR:(SER->RTR->SW->NEWNET)
Return Path:(NEWNET->RTR->SER)

This is the path that is taken every time.

Where as the ones that do accept the redirects get a temporary route statement in their table, once that times out they forward to the default gateway again, who proceeds to give them another redirect. How everything is taking an expected path so it is happy:

1st Attempt out: (SER->RTR|| Use this route instead)

Path out ICMP-REDIR: (SER->SW->NEWNET)

Return Path:(NEWNET->RTR->SER)

When you are dealing with things that have connection tables/states, applications that are expecting certain consistencies and possibly even source based routing on your hosts and you locally have asymmetric routing, thing will either kinda of limp along somehow or they will completely break. Neither one is what you want.

A good analogy would be if you invited your SO over and told her to pick up some love tubes on the way, you to the door and make sure the mood is right in the lovepad you open the door with eyes closed, lips puckered and you're handed your condoms, it's not your girlfriend handing them to you though, it's some weird stranger who just happened to get them for you after hearing that you wanted them, you'd probably be a bit weirded out.

The redirect would be the equivalent of you SO telling you that they wouldn't be able to make it there tonight but they have a friend in the area to help us out and get what we need.

SECURITY CONSIDERATIONS OF REDIRECTS AND MULTIPLE L3 DEVICES IN ACCESS LAN If you decide you're going to put an access list on the switch because you don't want it to access XYZ server, well that's cool, I can just change my gateway to the other device that routes making that a completely null point (assuming they both know how to get there). The reason I'm bringing this up is because generally when I run across this happening it's because someone decided they were going to put their firewall on the network as the exit point, but then they put in a layer 3 switch with an IP in every network and that's the default gateway. It completely voids the fact that you have a firewall, because the switch is local to everything, I don't need to have my access to internal resources inspected and passed, I just go through the switch. This may not be the case for what your doing but it gets the "you should have rigid boundaries" point across. And you NEED to turn off redirects everywhere unless you have some reason that I have yet to hear. If you need to get to a specific host/subnet, add a static route on your host instead of dynamically learning it from an unsecured protocol, you're opening yourself up to DOS from route poisoning and MITM attacks. Anyone can spoof an ICMP redirect, and like when those redirects are sent it's just that device guessing what it should be based on what's in it's table, which might be completely wrong if it was from a reconfigured router advertisement.

If you have three user LANs put that on one switch have the default gateway for that switch be your firewall/router in a separate transit network defined as a separate zone. Do the same for each border you have and make sure they all go through one place that controls access to resources between them.

8
  • "The problem is that your pointing your default gateway to another device that is still local to the clients as it's default gateway which is causing asymmetric routing and making connection inconsistencies that the applications/hosts probably don't like much." But how is it even getting there? Why isn't it using the "Local vlan102 10.168.102.1" route? Commented Sep 23, 2015 at 17:16
  • Well you need to have one exit from each network segment... it wouldn't solve the root issue. Your servers traffic wouldn't know where to go after it got to .1 If .2 is the only device with access to the next hop, you either need to make it 10.168.102.1 and find only a management IP for the other deivces, otherwise you could change the default gateway for all the servers to .2. I drew this up to give you a reference on that I mean, it's a little sloppy and isn't accurate for your network obviously but you might be able to take something away from it. imgur.com/kogAEDm HTH :)
    – Fallacy11
    Commented Sep 23, 2015 at 17:41
  • It is using the local .1 route but the route table on .1 has a default route of .2. When your .1 device sees that it doesn't have to do the leg work and can just tell you how it's getting out to the world, it tries to send you there so it doesn't waste it's resources doing something that the host could do on it's own. Set your default gateway to .2 on a server, I'm pretty positive you won't get redirects on that host. Unless both .1 and .2 have different networks attached to them in which case I would really suggest looking at that diagram.
    – Fallacy11
    Commented Sep 23, 2015 at 17:44
  • Thank you, Yes, I can set the GW to .2 on the servers and I no longer see the ICMP redirects. I was wondering if there was a better solution, though based on your explanation, it seems not. ( at least without redesigning the network ) Commented Sep 23, 2015 at 17:53
  • There possibly could be, without knowing the actual differences of .1 and .2 (as far as VLAN and Network access) I can't say for certain. That design was mostly for being able to efficiently define security boundaries to just fix the issue you're having and build redundancy, you could configure vrrp groups for each access lan, then upstream have RIP forward traffic to the VRRP master, if the master dies, RIP will automatically switch routes and VRRP will move the gateway to the healthy switch. That should be mostly downtime free to setup.
    – Fallacy11
    Commented Sep 23, 2015 at 18:13

Your Answer

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

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