sending through non-default gateway

Discussion in 'Python' started by Nikola Skoric, Feb 5, 2011.

  1. Is there a way to create a TCP connection using a gateway of my
    choice?

    I have a regular user account on a WinXP machine. It has a DNS server
    and default gateway configured, and that DNS server and default
    gateway don't see the rest of the Internet, just the local
    network. But, I know an IP address of another DNS/gateway pair which
    is used to access the Internet, and I can ping them (and send nslookup
    queries) from my machine.

    So, is there a way to tell python "don't use my default gateway, here
    is an address of the gateway I want you to use"? I've been googling,
    but to no avail...

    --
    "Now the storm has passed over me
    I'm left to drift on a dead calm sea
    And watch her forever through the cracks in the beams
    Nailed across the doorways of the bedrooms of my dreams"
     
    Nikola Skoric, Feb 5, 2011
    #1
    1. Advertising

  2. IIRC, this is an instance of what's called "source routing", and was
    largely shut off after network admins realized it was a security
    issue.

    Of course, if you have root/administrator permission, you could
    probably do it. But if you have that, you could probably just fix the
    routing table.

    On Sat, Feb 5, 2011 at 11:30 AM, Nikola Skoric <> wrote:
    > Is there a way to create a TCP connection using a gateway of my
    > choice?
    >
    > I have a regular user account on a WinXP machine. It has a DNS server
    > and default gateway configured, and that DNS server and default
    > gateway don't see the rest of the Internet, just the local
    > network. But, I know an IP address of another DNS/gateway pair which
    > is used to access the Internet, and I can ping them (and send nslookup
    > queries) from my machine.
    >
    > So, is there a way to tell python "don't use my default gateway, here
    > is an address of the gateway I want you to use"? I've been googling,
    > but to no avail...
    >
    > --
    > "Now the storm has passed over me
    > I'm left to drift on a dead calm sea
    > And watch her forever through the cracks in the beams
    > Nailed across the doorways of the bedrooms of my dreams"
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >
     
    Dan Stromberg, Feb 5, 2011
    #2
    1. Advertising

  3. Dana Sat, 5 Feb 2011 14:13:11 -0800,
    Dan Stromberg <> kaze:
    > IIRC, this is an instance of what's called "source routing", and was
    > largely shut off after network admins realized it was a security
    > issue.
    >
    > Of course, if you have root/administrator permission, you could
    > probably do it. But if you have that, you could probably just fix the
    > routing table.


    Yeah, I don't have admin priviledges, it's my office computer which is
    supposed to be cut of the Internet.

    I did a bit of reading on source routing and I'd like to try it. Just
    for fun, in case our router accepts such packets. So, is there a way
    to do it in python?

    --
    "Now the storm has passed over me
    I'm left to drift on a dead calm sea
    And watch her forever through the cracks in the beams
    Nailed across the doorways of the bedrooms of my dreams"
     
    Nikola Skoric, Feb 6, 2011
    #3
  4. On Feb 6, 1:10 am, Nikola Skoric <> wrote:
    > Dana Sat, 5 Feb 2011 14:13:11 -0800,
    > Dan Stromberg <> kaze:
    >
    > > IIRC, this is an instance of what's called "source routing", and was
    > > largely shut off after network admins realized it was a security
    > > issue.

    >
    > > Of course, if you have root/administrator permission, you could
    > > probably do it.  But if you have that, you could probably just fix the
    > > routing table.

    >
    > Yeah, I don't have admin priviledges, it's my office computer which is
    > supposed to be cut of the Internet.
    >
    > I did a bit of reading on source routing and I'd like to try it. Just
    > for fun, in case our router accepts such packets. So, is there a way
    > to do it in python?


    You don't need real source routing (and real source routed packets
    will probably be dropped by the first router that sees them). You
    just need to make a different decision at the first hop. You can do
    this with the SO_BINDTODEVICE option on a raw socket. But this
    probably also requires administrative privileges.

    Jean-Paul
     
    Jean-Paul Calderone, Feb 6, 2011
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mauro
    Replies:
    1
    Views:
    297
    Konrad Rotuski
    Oct 27, 2003
  2. John Abel

    Sending Through ^] Through telnetlib

    John Abel, Jan 23, 2004, in forum: Python
    Replies:
    2
    Views:
    377
  3. Mahrt, Dallas

    RE: Sending Through ^] Through telnetlib

    Mahrt, Dallas, Jan 23, 2004, in forum: Python
    Replies:
    0
    Views:
    536
    Mahrt, Dallas
    Jan 23, 2004
  4. John
    Replies:
    0
    Views:
    1,093
  5. John
    Replies:
    0
    Views:
    1,092
Loading...

Share This Page