Linux – RHEL 6 / CentOS 6 two NICs in the same subnet, but secondary doesn’t ping

Recently I ran into a problem with RHEL 6 (and any derivatives, like CentOS 6 or Scientific Linux 6) where having two NICs (network interfaces) in the same subnet resulted in strange behaviour. In RHEL ≤5 (or CentOS ≤5), one could have two interfaces with IPs in the same subnet and there weren’t any problems (besides the obvious question of why one would set it up this way instead of just bonding the interfaces). However, in RHEL 6 (or CentOS 6), having two interfaces with IPs in the same subnet results in the primary one pinging but the secondary one not responding.

The cause of this problem is that the rp_filter settings changed between these kernels (2.6.18 in RHEL 5 and 2.6.32 in RHEL 6). In RHEL 5, the rp_filter setting was a boolean where 1 meant that source validation was done by reversed path (as in RFC1812), and 0 meant no source validation. However, in RHEL 6, this setting changed to an integer with the following settings:

*****
0 – No source validation

1 – Strict Reverse Path validation (RFC3704) – Packets are checked against the FIB (Forwarding Information Base), and only the best ones succeed

2 – Loose Reverse Path validation (RFC3704) – Packets are checked against the FIB, but only non-reachable BY ANY INTERFACE will fail
*****

So, though the default setting is still 1, it now has a different meaning. In order to get these two network interfaces with IPs in the same subnet to both respond, I needed to make two changes in /etc/sysctl.conf:

  • Change net.ipv4.conf.default.rp_filter from ’1′ to ’2′
  • Add the line net.ipv4.conf.all.rp_filter = 2

To better illustrate the changes, here are the differences:

DEFAULT SETTINGS:
# grep '.rp_filter' /etc/sysctl.conf
net.ipv4.conf.default.rp_filter = 1

REQUIRED SETTINGS:
# grep '.rp_filter' /etc/sysctl.conf
net.ipv4.conf.default.rp_filter = 2
net.ipv4.conf.all.rp_filter = 2

In order to make these changes effective immediately, you can reload the configuration with:

# sysctl -p

Ultimately, the new defaults make it so that the kernel discards packets when the route for outbound traffic differs from the route of incoming traffic. Changing these settings as mentioned above will make the kernel handle those packets like it did before 2.6.32. That way, having two or more interfaces with IPs in the same subnet will function as intended. Also, these changes aren’t limited to just RHEL 6 and derivatives, but also to any distribution with ≥kernel-2.6.32 in which the defaults were not changed.

Cheers,
Zach

Drill Sergeant surprised by a boy’s response about fatherhood

A friend of mine recently sent me a link to this video clip of a Drill Sergeant coming down hard on a preteen boy for his bad behaviour (taken from the Jenny Jones show, Bootcamp my Preteen episode). The boy’s response caught him off-guard, but should serve as a reminder to us of the different situations that children have to endure.


Drill Sergeant stunned by preteen boy’s response – Jenny Jones – Bootcamp my Preteen

Thailand travel days 2

Today is the last day of our trip to Thailand. I’m a bit disappointed about the vacation coming to an end, but am happy to be getting back home. I was really excited about coming to Thailand, but many of the things to which I was looking forward were letdowns. It is upsetting when you spend weeks and weeks planning every little detail, and several things end up not going how they should have gone. That being said, it was a wonderful experience that I wouldn’t trade for anything. Maybe one day I will make it back to Thailand, and see some of the other treasures that it has to offer.

We started out the day with breakfast at Café Mozu, which consisted of a lot of freshly-made pastries, some great meats, and made-to-order omelettes. Some of the pastries were truly extraordinary, but overall, I found the buffet to pale in comparison to the one at the Eastin Grand Sathorn.


The pool at Lebua Bangkok – Mozu Floor
Click for larger, higher-quality image

After breakfast, we headed northeast on Silom Road to find the Silom Cooking School. It seemed like an interesting activity, but upon arrival, we found that it wouldn’t work for the day. As such, we basically just walked around the Silom district for a while and headed back to the room for some relaxation.

We lounged about for quite some time, got everything packed, and then had dinner at Taling Pling (which was only a few blocks away from the hotel). It wasn’t all that great of food, and the service was miserably bad, but it served the purpose. After dinner, we checked out of the hotel (which again, took WAY longer than it should have), and we headed to BKK. Our flight wasn’t until 01:00 GMT+7 Saturday morning, but we needed to get there a couple hours early since it was an international flight.

At BKK, I found it interesting that they had a Dairy Queen. I noticed that many of the flavours were the same as in other countries, but that there were ones that were unique (such as green tea with red bean). I went for the ol’ trusty Oreo, and it was a nice treat.

The flight from BKK back to Tokyo Narita was rather uneventful, and I actually got to sleep a little bit. With the tail wind, it was even about 45 minutes shorter. We had a layover in Tokyo, so we went to the American Airlines Admiral’s Club to relax for a bit. We had some cereal, tea, and various snacks before the lengthy flight from Tokyo to Chicago O’Hare. That flight, too, was substantially shorter because of the tail winds. Fortunately, neither flight felt as bad as they had when we were departing for Bangkok.

With a five-hour layover in Chicago, we again took advantage of the Admiral’s Club membership, and here I sit. As said, there were many disappointments to me on this trip, but those were completely due to things not working out the way that I had intended. I spent a lot of time planning, but I need to learn that there are some things that just can’t be helped–I need to work on flexibility. I really enjoyed the experience, and hope that future travels will be just as outstanding, if not even better.

Cheers,
Zach