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.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

I have what I imagine is a fairly simple problem to resolve, but I cannot seem to find anything that is actually helpful so I've now come here. Here's the situation...

My machine has 2 interfaces, 1 being wireless. What I want to do, is to be able to accept connections on the wireless interface, and route them out the other interface, basically a proxy. Every solution I've managed to find requires that the wireless interface be on an Ad-Hoc connection, and this is just not possible. Both interfaces ARE able to connect to the internet, but I need everything to route through the non-wireless one. I've tried srelay but can't find any documentation on configuring it anywhere. I've also seen suggestions using route / iptables, but again, nothing that I can translate into applying to my scenario, perhaps something like netcat? Any assistance would be greatly appreciated.

you've got three things badly mixed up here... a router is NOT a proxy. Do you want to route or proxy? Or do you actually want to switch? do you have multiple subnets, or a single flat L2 domain excluding your internet connection? What you've stated as being able to accept connections doesn't really seem like a clear scenario to base a requirement on. Can you rephrase it in terms of actual use cases?

I have a box with a wireless and a cellular connection. The wireless is connected to the enterprise network where I work. The cellular obviously to the cellular network. My goal is to proxy from the wireless to the cellular. Everything I have tried so far that even comes close to working, ends up routing the request back out the wireless network to the net rather than through the cellular interface. My original post was written rather hastily. Hopefully that clears it up.

It's like this... my actual PC is on a wired network. The wired network is bridged with the wireless network. I need to proxy through the wireless interface of my linux box through the cellular interface. I must retain my current gateway on the work PC. I've tried srelay, and I can get it to proxy, but it still sends the proxied requests out the wireless network.

OK, (I think) I understand your diagram. You are running foo application on the Work PC, and you need to proxy certain requests from it through the Linux box (so that it leaves the 192.168.2.3 interface to the 'net).

So you need to:

Enable the Linux Box to be a gateway (so that after requests from the Work PC have passed through the bridge they can make their way to the 192.168.2.3 interface).

Run the proxy daemon and have it listen on the 192.168.2.3 interface.

Point foo's application settings on the Work PC to use 192.168.2.3:<port> as its proxy.

My problem was that the proxy was routing requests back out the wifi interface, using srelay. I can't find any docs for that though so I could be missing an option. I am currently trying to use 3proxy. When I use the socks option, I get just a blank page for everything. When I use the http proxy option, I get 502 bad gateway for everything.

another issue i see is that the ip of the cellular connection changes quite frequently. Everything I've tried so far I must specify an external ip, ideally I'd like to specify an interface.

My problem was that the proxy was routing requests back out the wifi interface, using srelay.

Then you need to set up your Linux Box routing tables such that 192.168.0/24 requests get sent out the wifi interface, and all other traffic gets routed to the cellular network's gateway. (In other words, that will be your default router.)

Quote:

Originally Posted by Vaelek

another issue i see is that the ip of the cellular connection changes quite frequently. Everything I've tried so far I must specify an external ip, ideally I'd like to specify an interface.

In this case, you will likely have to set up the daemon to bind to all interfaces.