Categories
LAN Software

OpenVZ on a Softlayer managed server

A post to record list of changes that were made to the configuration to get networking to work within the VZ containers on a managed hardware node.

Softlayer provisions CentOS machines with two bonded network interfaces: bond0 connected to their private network and bond1 to the public. We got a “portable” private network subnet and got them converted to “routed to subnet” so that all IPs in that subnet are usable (instead of 3 of them getting reserved into a broadcast IP, gateway IP and broadcast IP).

OpenVZ sends ARP requests when it’s trying to initialise a container and the interface to which the requests are to be sent has to be explicitly specified in this multi-network case. So, fix the NEIGHBOUR_DEVS variable in /etc/vz/vz.conf before you pick IPs from your portable subnet pool and start assigning it to your containers.

With that, you should be able to ping these containers from other nodes in your primary private subnet and vice versa. But you won’t be able to ping public IPs from within the containers yet. This doesn’t require you to assign public IPs to the containers too. A NAT rule on the host node should fix this: iptables -t nat -A POSTROUTING -o bond1 -j MASQUERADE

Took me a while to recall/realise that the lack of ARP requests in SL’s network was necessary. The NAT rule was something I found later on on the internet.

Categories
LAN Work Life

Using Dnsmasq to serve from a central /etc/hosts

Recently at $work, I came across a situation where: a. public DNS records are served off of a GoDaddy account and b. a couple of domain names needed a office network-wide override pointing it to IPs in the local network.

i.e.

dig +short @8.8.8.8 qa.example.com

<returns public IP>

dig +short qa.example.com

<returns private IP>

If there aren’t too many consumers for this name resolution, we could’ve done with putting in entries into /etc/hosts on each consumer host. But our consumer hosts included a lot of android phones. And we didn’t want to root them all to be able to modify their /etc/hosts.

If we were running our own DNS server in our DMZ, we could’ve configured the infamous split-DNS setup through BIND or tinydns. (Un)fortunately, we didn’t.

The first "workaround" to this was to maintain a duplicate zone for example.com on our local DNS server (the one served by our DHCP server) and override the records as required. This would soon start to suck.

A colleague of mine – who didn’t take my word that the above two methods are our only options available – persevered through the PowerDNS docs and found an option where it could serve off the host’s /etc/hosts file. Now what was brilliant about this was, adding a ‘192.168.1.223 qa.example.com’ into /etc/hosts effectively solved the problem we had!

We didn’t really needed a full-fledged DNS server like PowerDNS and I looked if dnsmasq could solve the same problem – and it does.

[root@blr-vbox1 ~]# egrep -v ‘^#|^\B+’ /etc/dnsmasq.conf
bogus-priv
resolv-file=/etc/resolv.conf.isp
interface=eth0
no-dhcp-interface=eth0
no-dhcp-interface=lo0
conf-dir=/etc/dnsmasq.d

Our ISP’s DNS servers go into /etc/resolv.conf.isp

Ensure that the host that’s running dnsmasq has only ‘nameserver 127.0.0.1’ in /etc/resolv.conf and put in all your entries to be served into /etc/hosts.

Categories
College Life Entertainment Personal Worldly Matters

Updates as of 3rd May, ’09

Part 1

Plenty of things have happened ever since the humble beginnings of this semester that just ended with my last exam 4 days ago. Let me try summing up how things went this semester – which should’ve been my last semester here in my campus. I’m still unsure of the current state (OARS likes to keep secrets from me until a select date, what can I do?)

Right before this semester started, I remember partying* almost everyday. It was the winters I stayed back for to jumpstart on my second part of the BTP, but it turned out to lead me on a whole different path altogether. The semester starts and a few classes were attended. Soon, the “everyday partying” mode kicked back into our (the ones who were partying) lives. I’ll refrain from mentioning any detail regarding the others. This new way of life was, well, new to me. Partying everyday only to end up lethargic enough to not do anything else for almost a couple or more months during a semester – woah! How irresponsible and devoid of self-discipline I must’ve been. I was the kind of person who was largely amotivated and had no long term goals at that point. To keep up with my lethargic life and give time to partying, I cut myself off from other activities I kept myself busy with.

In the second half of the semester I had reached such a crazy state that I couldn’t sleep well without partying that night. It took me some self-realisation, re-orientation towards my purpose in being a student at this campus and most importantly, strong-minded individuals to help me get back on track. And boy was it a good one. It feels good to be reborn this way. Makes one think about the future once in a while rather than live completely for the present.

Evenings spent with a certain individual thinking back on how things went helped me reshape myself. The “everyday partying” mode that I had been in wasn’t completely a bad thing, it had its own share of pluses and minuses. The decision I made was to stick with moderation and to give up on certain things altogether. I’m just glad I’m making my own decisions. People aren’t the only things that can influence the state of mind. There are other things too.

I blame nobody at this point. It’s quite unfortunate if I’ll have to stay back in the campus for a while longer. But I’m glad I’m a different person today. On the other hand, maybe I wouldn’t have minded my “everyday partying” mode much had I been better off in life. You know? Like an owner of an island off the Pacific or something. Living my own life. But that’s not the case. I’m a student. I need to dedicate time to being one.

partying: wasn’t really celebrating anything, started off purely as a recreational activity and turned into a daily, dull-ish chore. Mind altering intoxicants were involved.

Part 2

This section is dedicated to observations I’ve been making on the people around me in this not-so-normal (temporary) human settlement. Let me list a few characteristics of the environment: The weather here ranges from one extreme to the other. Everyone gets a share of their favourite weather. Food – good for some, bad for some, unbearable for some. Totally skewed male-to-female ratio. Amotivated students. Motivated students. Good faculty. Old-school faculty. Comfort-oriented, make-lots-of-money-as-soon-as-possible kind of students. Whacky, I’m-the-next-avatar-of-Lord-Vishnu kind of students. I’m-perfectly-right-and-everyone-else-is-a-retard kind of students.

This list doesn’t end so easily. This place, as an environment to aspiring engineers, scientists and researchers, consists of a wide variety of inhabitants where plenty of them genuinely require help and constant evaluation at regular intervals to help to re-orient themselves to their true purpose in being here – as a minimum requirement. I mean, come on, this place is supposed to serve a few purposes, quite specific ones at that. Once a student is able to focus with that, if he’s got the time, he can go in directions that don’t affect his focus as much as he pleases. Actually, I’d have loved to refer to a document of sorts that lists what is expected of of a student in this campus. I’m unable to find it on the institute website and if such a document really exists, it’d be a good document to look into once in a while.

These are, at best, observations and suggestions. I don’t want to make judgments on any individual. I prefer humility and losing once in a while rather than having to go off my top and belittle a person because it didn’t fit my view of things or whatever it is that should’ve made me boil with anger or fill me with the need to “correct” a person so I can “satisfy” myself. Or maybe this is how some are accustomed to satisfying themselves. It’s pretty messy towards people who haven’t learnt to adopt a nonchalant nature when it’s called for. Washing dirty linen in the public? No thanks.

Part 3

The undergrad students in the newer batches seem to be a lot more focused compared to the ones in my batch. A friend of mine went “just as I thought” when I mentioned this to him with the anti-ragging initiatives in mind. He says (and I agree with him, empathise even) that the “ragging” sessions that take place during the first fifteen days of a fresher’s stay here is detrimental to their lives in various ways for the rest of their lives here and beyond. One of the ways in which it affects the not so careful fresher is his being accustomed to a mediochre student life. Missing classes, gaming, movies, tv series, intoxicants, and so on are some of the obvious side effects of these “interaction sessions”.

I belong to the Y4 batch and I’m in touch with students from the younger batches (Y5, Y6 and Y7). This semester (and the previous one) I happened to witness certain things that were quite different from how things used to be in the Y4 and Y5 batches. The anti-ragging initiatives were active from the Y6 batch onwards. Lucky chaps. You can see them attend a lot more (CS classes, I happen to be in the CS department so I’ll refrain from talking about the other departments – some departments are known to drive students in their final years crazy) classes, with plenty of scoring A’s and living a decent student life. Man! I wish I had been in their batch.

Things have begun to look a lot brighter now. The newer, younger faculty too are just as sincere and simply superb. It relieves me personally to think that these faculty won’t lose hope and continue to give their best in this symbiotic relationship that’s supposed to exist in this place. Had such faculty been initially exposed (and continued to be exposed for a few batches down the line) to batches such as ours who’ve been “ragged”, who knows, they might lose hope in students down the line and turn harder or rigid.

Note to self: Exercise your body (that includes your brain) regularly and stop being a prick.