Posts tagged with “resolution”

Thu 18 Aug

The Case of the Mystery IGMP Query Request

I've spent two days trying to track down the source of mystery IGMP query requests on a network emulation testbed I'm building. All the machines are (essentially) stock installations of Ubuntu 11.04, with no services running besides sshd.

One of my machines acts as a poor man's Ethernet tap. Its two NICs, which are connected to the two machines that run the system I'm testing, are bridged together, allowing me to run tcpdump on the bridge interface (br0) to capture packet traces from the experiments I run*.

I noticed some strange IGMP queries originating from this monitor machine, and after several hours of hunting for the source I found that it was actually coming from this bridge device! It turns out that the bridge module in Linux supports IGMP snooping. I'm sure this is a useful feature for certain scenarios, but when you're trying to make sure no non-intentional traffic is moving across your NICs it is not at all useful.

Anyway, once you've figured this out the solution is simple: just disable IGMP snooping. You can (thankfully) do this via a sysctl variable:

cd /sys/devices/virtual/net/br0/bridge
echo 0 | sudo tee multicast_snooping

Once you do this, the pesky IGMP queries will go away. You can make this permanent (in Ubuntu, anyway) by adding these lines to a script under /etc/network/if-up.d/.

This page was helpful in solving this problem, as it provides documentation about the sysfs features of the bridge module.

*Yes, I know this is not a real Ethernet tap, but with the equipment, budget, and schedule I have (as well as my desire to run at 1Gbps, rather than 100Mbps) this is the best I can do.

Thu 16 Sep

How to Kill an Unresponsive SSH Session, and other useful escape sequences

I always forget how to do this.

[newline] ~ .

That's enter key, tilda, then period. Presto, back to your friendly (local) console.

Here are a few more useful escape sequences, straight from man ssh (note that all must be preceded by a newline character):

The supported escapes (assuming the default ‘~’) are:

 ~.      Disconnect.

 ~^Z     Background ssh.

 ~#      List forwarded connections.

 ~&      Background ssh at logout when waiting for forwarded connection / X11 sessions to terminate.

 ~?      Display a list of escape characters.

 ~B      Send a BREAK to the remote system (only useful for SSH protocol version 2 and if the peer supports it).

 ~C      Open command line.  Currently this allows the addition of port forwardings using the -L, -R and -D options (see above).  It also allows the cancella‐
         tion of existing remote port-forwardings using -KR[bind_address:]port.  !command allows the user to execute a local command if the PermitLocalCommand
         option is enabled in ssh_config(5).  Basic help is available, using the -h option.

 ~R      Request rekeying of the connection (only useful for SSH protocol version 2 and if the peer supports it).

Nod to this guy, whose site I've always wound up at when I'm trying to remember this.

· Tags: ,

Tue 29 Jun

python-mysqldb: execute() first

While working on implementing a schema-free, MySQL-backed data store (thanks, Bret Taylor!), I ran into a problem with using MySQLdb to access the database. I'll eventually post the code I wrote up on this site so others can see my example, but for now the following will suffice. When performing a SELECT, I would get the following error upon attempting to fetch my results.

Incorrect Python:
q = "SELECT body FROM entities WHERE id='%s'" % (entity_id)
entity = self.conn.cursor().fetchone()

File "", line 93, in get
entity = self.conn.cursor().fetchone()
File "/usr/lib/pymodules/python2.6/MySQLdb/", line 340, in fetchone
File "/usr/lib/pymodules/python2.6/MySQLdb/", line 70, in _check_executed
self.errorhandler(self, ProgrammingError, "execute() first")
File "/usr/lib/pymodules/python2.6/MySQLdb/", line 35, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: execute() first

The issue was using two separate cursor objects. Here's the corrected code:
c = self.conn.cursor()
q = "SELECT body FROM entities WHERE id='%s'" % (entity_id)
entity = c.fetchone()

Wed 23 Jun

ERROR: please fix package in OpenWRT

I'm putting together an OpenWRT package for a project I'm working on and ran into a perplexing error message as I was testing my new package's Makefile:

[[email protected] backfire]$ make menuconfig

ERROR: please fix package/click/Makefile

To get a more descriptive error message, enter the following from the root directory of your OpenWRT source distribution:

TOPDIR=$PWD make -C package/ DUMP=1

Doing this let me discover that I was using a deprecated description tag inside my Makefile.

Sat 19 Sep

Printing to the UNC Pharos System from Linux or Mac

For the Linux users I know around campus, this has always been one of those "Gee, wouldn't it be great if..." problems. Actually, printing to the university printing system is pretty easy. This also enables printing from Macs as well; see the section on Mac below.

Update Fall 2009: These instructions should remain valid for the new (IMHO, not improved) ONYEN-authenticated printing system. The primary change is that your login name must match your ONYEN. Take a look at Max's Mac instructions for a possible alternative solution.


This was tested on Ubuntu 7.10 Gusty, but I reckon it should work on any distro with cups. You'll need cups to do this. I've also been told that it works on Fedora 8 with CUPS 1.3.3.

In Ubuntu 7.10 Gusty:

  1. Fire up Firefox or your browser of choice. picture
  2. Go to "http://localhost:631". picture
  3. Click on "Administration". picture
  4. Click on "Add Printer". Fill in any values you like for Name, Location, and Description, then hit next. picture
  5. Select "LPD/LPR Host or Printer" from the drop down menu. picture
  6. Enter "lpd://" for the device URI. picture
  7. Select the print driver for HP Laserjet 9050. It's important you select this as ResNET has reported instances of printers locking up when they receive jobs sent for generic PS printers, but work fine when they receive jobs from their proper driver. All ITS printing stations on campus are HP Laserjet 9050s.
  8. You may be prompted for authentication at some point. Enter your local admin username and password. picture
  9. The printer has been added! picture
  10. A configuration page will appear in a few moments. You can play with settings here, or leave them alone. I highly encourage you to turn on double sided printing now. You can repeat this process and make another printer that produces single sided sheets if you want. picture
  11. Go back to "Administration" and click "Manage Printers". You'll be able to manage your new printer from there, as well as print a test page. picture

Documents you print will appear on the Pharos station under the username you are logged into.

This should work on most modern distros. If it does not, here is the relevant information:

hostname: (ip:
queue name: CCI_Printing
Use the HP LaserJet 9050 driver.


Update Sept 17, 2010: Note that since this article was first written, UNC ITS has released a client for OS X; see this help article. These instructions may still be simpler for you to use, though (no extra software to install and no extra popups!).

How to set up CCI Printing on Mac OS X via LPD (thanks to Max Beckman-Harned and J. Bromberg!):

(Instructions good as of 8/24/09; for OS X 10.5):

  1. Go to Apple Menu -> System Preferences -> Print & Fax
  2. Click the + button
  3. Click on "IP" at the top.
  4. Select "Line Printer Daemon - LPD" from the protocol list.
  5. Enter [email protected] into the Address field. For example, my ONYEN is macmaxbh, so I'd enter in [email protected] . Mac OS X will tell you this is an "invalid or incomplete address", ignore it (it should say is valid, it doesn't understand the username specification, but the underlying printing system does).
  6. Enter CCI_Printing in the queue field.
  7. Name the printer in the "name" field, something like "UNC" or "CCI Printing" or whatever you like.
  8. Select "Select a driver to use..." from the "Print Using" field.
  9. Type 9050 in the search field and select "HP LaserJet 9050" from the list.
  10. Click "Add".
  11. Check "200-Sheet Input Tray (Tray 4)" and "Duplex Unit" from the list, click "Continue".
  12. CCI Printing via LPD is now set up!

Two further notes:

  • When you print, you will NOT get any popup, your print job will immediately be sent to the printer.
  • You may need to check "Two-Sided" or select "Long-edge binding" to get two-sided printouts; this may not be done by default.

That's all there is to it! Contact me ([email protected]) if you have issues.

· Tags: ,
Next → Page 1 of 2