Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got an Ubuntu 10.11 box with a wireless connection and a wired connection. In the wired end I've got a rented network printer whose configuration I can't change (no access). It is set up to use dhcp and access the internet through gateway It needs an internet connection to email scanned documents to users.

The wireless network is in fact the 10.0.0.X subnet, the gateway is, and the wireless router has a dhcp server. I can change all these settings if needed.

I want to make it seem to the printer and all the other PCs on the wireless network that it's just a regular participant on that network. I'm quite proficient when it comes to setting up internet connections and configuring wireless routers, but this kind if thing is a strange new world. I've looked at a lot of guides to setting up linux as a router or NAT or bridge, but no guide seems to tell me how to achieve what I want. So far I've set up ipv4 forwarding and installed webmin, bind9 and a dhcp server, but it seems to me I shouldn't need any servers to do this.

If someone could provide just a small push in the right direction it would really help a lot. I don't even know what this I'm trying to achieve is called, so it's hard to google.

share|improve this question
up vote 1 down vote accepted

I can't give you exact steps, but I can give you some background information to help you figure out what to Google next.

I think you already know that passing Ethernet-like traffic from one Ethernet-like port to another without modifying it is called "bridging". Bridging between a wired Ethernet link and an 802.11 wireless link is easy if you're the AP, but hard otherwise. It either requires that both ends of the link support WDS ("Wireless Distribution System") or that the non-AP device (your Ubuntu box) act as a "Proxy STA". This is because by default, APs only accept frames from the MAC addresses of the wireless clients (STAs) that have Authenticated and Associated to the AP. So if your Ubuntu PC tried to join your wireless network normally, and then started bridging frames from the printer, the AP would reject those frames because it didn't recognize the MAC address of the printer as being one of the MAC addresses that had Auth'd and Assoc'd to the AP. So if you want to bridge frames on someone else's behalf, you either have to have both ends of the wireless link support WDS so that bridging frames on behalf of non-Associated devices is allowed, or your have to have the wireless client perform a fake 802.11 Authentication and Association on behalf of any wired Ethernet devices it's bridging for (this is called "Proxy STA").

One other option would be to renumber your main wireless network so it's not on the same subnet as the one on the printer, and then run NAT on your Ubuntu box so that the private side of the NAT is 10.0.0.x facing the printer, and the public side is facing the rest of your wireless network. Then your Ubuntu box could just join your wireless network like any other wireless client. You would also need to set up port mapping (port forwarding) on your Ubuntu box for whatever ports your favorite printing protocols use. The one downside of this is that your printer's service announcements wouldn't make it through the NAT, so your printer wouldn't automatically appear on the network when people browse for it. They would have to manually set up their print queues to print to the "public" IP address of your Ubuntu box, and your NAT port mapping would take care of forwarding that traffic to your printer.

A third option might be to set up some kind of print server software on your Ubuntu box, so that your Ubuntu box offers print services on the network and actually just spools the print jobs and dispatches them to the printer. You'd probably still have to make sure that the printer is not trying to use the same IP subnet as your main network, otherwise your Ubuntu box's network stack would get confused as to which interface to use by default for that subnet. But in this case, you probably wouldn't need to do NAT on your Ubuntu box.

Note that there are boxes that do Proxy STA available for very cheap, like $38 (US) cheap. They're generally called "wireless ethernet bridges" or "wireless gaming adapters" or some variant of that. If you think about your hourly pay rate and how much time it's been taking you or going to take you go make this happen via Ubuntu, it might be more economic to just stop by an electronics store and buy one of these devices.

share|improve this answer
This was very useful info, thank you! – Lauritz V. Thaulow Apr 25 '12 at 7:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .