How do I forward connections to a computer on a bridged network connection?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I forward connections to a computer on a bridged network connection?
I have two computers connected together via Ethernet, and I've set up Computer 1 to share its WiFi Internet connection to Computer 2 using this guide. Everything works well, except that Computer 2 is being issued IP address 10.42.0.70 by Computer 1 rather than a 192.168.1.x address by my wireless router, so Computer 2 and the other computers on my network (besides Computer 1) can't access each other. Is there a way I can set up Computer 1 so that connections made to a certain port on it will be forwarded to Computer 2?
That is definitely not a guide for network bridges. It just tells you how to set up your network card to use auto (dhcp) settings, using a specific GUI tool of a specific Desktop Environment. You need a package called bridge-utils, and use brctl to set up a bridge in Linux.
This tutorial on the Ubuntu forums is actually how someone bridged their WiFi and Wired networks, this is more likely to get you to your goal. The tutorial you used turns the machine into a router, not a bridge.
Okay, I found this article in the Debian wiki describing how to set up a network bridge via brctl. Just so I'm fully clear before I try this, it will allow my router to see both computers and issue them each a unique IP address, correct?
A bridge allows all members to see the traffic. The only issue I see as possible is your wireless refusing to transmit traffic that originates from a different MAC addresses. I have had this happen and ended up having to use a proxy server on the machine I tried to use as a bridge. But that was also with an old chipset.
It looks like the writers of brctl anticipated that problem, because running
Code:
# brctl addif br0 eth0 wlan0
yields the message "can't add wlan0 to bridge br0: Operation not supported." Searching around on forum posts indicates that the MAC address authentication issue is the reason for this.
I think I'm just going to get a wlan card for Computer 2. That way I won't have to have both computers on to access the network from it.
Thanks anyway for the assistance.
Last edited by Kvbx4; 07-29-2012 at 11:17 AM.
Reason: wording
It can be done though because I have done it, and the article you linked to uses ebtables to get around the MAC address issue. I don't know why it won't bridge them.
After reading a couple posts you need to change the operating mode of your wireless card. Your wireless will not obtain an IP address, ethernet interface should. Look at hostapd http://linuxwireless.org/en/users/Documentation/hostapd this would turn the wireless card into an AP essentially and allow you to bridge it. That is provided the chip set supports the proper operating mode https://help.ubuntu.com/community/WifiDocs/MasterMode
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.