Only route traffic from select URL(s) to sshuttle

136 views
Skip to first unread message

Toki Tahmid

unread,
Sep 23, 2011, 9:10:28 AM9/23/11
to sshu...@googlegroups.com
Is that possible?

Gert Van Gool

unread,
Sep 23, 2011, 9:16:35 AM9/23/11
to Toki Tahmid, sshu...@googlegroups.com
If you know the IPs of those URLs, you could do that without trouble.

To find out the (public) IP, you can use DNS (dig -t A google.com),
which will return a number of IPs (e.g. 74.125.79.147, 74.125.79.99,
74.125.79.104).

You could also look-up which IP ranges are allocated to the companies
in a database like RIPE (for Europe, http://ripe.net).

-- Gert

Mobile: +32 498725202
Twitter: @gvangool
Web: http://gertvangool.be

On Fri, Sep 23, 2011 at 15:10, Toki Tahmid <oxw...@gmail.com> wrote:
> Is that possible?

Toki Tahmid

unread,
Sep 23, 2011, 9:20:06 AM9/23/11
to sshu...@googlegroups.com
Okay, assuming I have the URLs what to I do with it?

(sorry for the double email, Mr Gert)

On 23 September 2011 17:18, Toki Tahmid <oxw...@gmail.com> wrote:
Okay, assuming I have the URLs what to I do with it?

Roger

unread,
Sep 23, 2011, 9:23:17 AM9/23/11
to Toki Tahmid, sshu...@googlegroups.com
On Fri, Sep 23, 2011 at 9:10 PM, Toki Tahmid <oxw...@gmail.com> wrote:
Is that possible?

That could be done with squid transparent proxy:

1. route traffic to squid with iptable rules
2. match URLs with squid ACL.
3. split the outgoing request of matched by setting another outgoing address, or route to another squid peer.
4. match the splitted traffic in iptables and direct it to sshuttle chain.

Roger

Toki Tahmid

unread,
Sep 23, 2011, 9:34:18 AM9/23/11
to sshu...@googlegroups.com
Is it all right being a noob on this mailing list? Because I don't know sh*t about squid, iptables, etc other than they exist.

Gert Van Gool

unread,
Sep 23, 2011, 9:38:59 AM9/23/11
to Toki Tahmid, sshu...@googlegroups.com
So, this would pipe a couple of work sites through a server at work
I've found the IPs through nslookup (http://bpaste.net/show/18880/)

./sshuttle -r office.citylive.be 79.125.13.31/32 46.137.62.21/32 79.125.17.29/32

-- Gert

Mobile: +32 498725202
Twitter: @gvangool
Web: http://gertvangool.be

Toki Tahmid

unread,
Sep 23, 2011, 9:57:11 AM9/23/11
to sshu...@googlegroups.com
Gert's method work great, thanks!

On 23 September 2011 17:56, Toki Tahmid <oxw...@gmail.com> wrote:
No, I meant only the 32 in 1.1.1.1/32. But it looks like only replacing 32 with 0 does not work.


On 23 September 2011 17:55, Gert Van Gool <gertv...@gmail.com> wrote:
That will redirect all traffic (0/0 is everything on the internet).


-- Gert

Mobile: +32 498725202
Twitter: @gvangool
Web: http://gertvangool.be



On Fri, Sep 23, 2011 at 15:53, Toki Tahmid <oxw...@gmail.com> wrote:
> What will happen if I replace 32 with 0? (usually I use sshuttle with 0/0
> parameter)
Reply all
Reply to author
Forward
0 new messages