Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have two network interfaces on a laptop running Ubuntu 12.04. The wired interface is plugged into a wirless router on the 192.168.0.0 network and then wireless interface is connected to an ad-hoc network on the 192.168.1.1 network.

I want to connect another machine to the wireless router and have the data be routed to the ad-hoc network. So the other machine will get an address like 192.168.0.4 and it should be able to send data to the ad-hoc network say to machine 192.168.1.100.

I've tried simply changing the /etc/network/interface text file, but I really don't know what I am doing there, and I tried installing some bridging software and that doesn't seam to help.

Any ideas? Thank you.

share|improve this question

migrated from stackoverflow.com Sep 28 '12 at 8:06

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer

up vote 1 down vote accepted

The problem with this setup is that your router can not route packets to the 192.168.1.0 network because it is not configured to forward packets to that network. I assume you have a standard home router such as Dlink, Netgear, Linksys, Belkin, and not a hardcore commercial CISCO router. What you need to do in order for another machine to reach the ad hoc device is to setup NAT masquerading using IPTABLES. Using NAT you will reach hosts in the 192.168.1.0 network, but only the ports that you specify. This is often referred to as port forwarding. Depending on the protocols you would to use, TCP,UDP etc the specific settings vary. Here is a good page that will get you started: http://linux.ardynet.com/ipmasq/ipmasq.php3

share|improve this answer
    
Thanks for the great link! I will try it out and let you know how it goes! –  Matthew Sep 26 '12 at 1:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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