Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
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.
No, I need it to act as a proxy, preferably SOCKS.
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.
Does that look right? (Ignore the specific RFC 1918 IP addresses; I presumed each interface was on a different subnet, and this diagram was intended to represent that.)
Vague still, but if the only problem is that your SOCKS5 request leaves in the wrong direction, then the routing table should just need some tweaking to change the default route at that point.
Does that look right? (Ignore the specific RFC 1918 IP addresses; I presumed each interface was on a different subnet, and this diagram was intended to represent that.)
It's more like this, using the same legend:
Code:
+----------+ +-------+---192.168.0.3-+-----((internet))
| | | Work | |
| Linux | | PC | |
| Box | +-------+ bridge
| | |
+-----+----+--------------------------192.168.1.3-+
|
|
192.168.2.3
|
|
((internet))
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.
Do those steps sound right? If so, where are you falling down?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.