+ Post New Thread
Results 1 to 4 of 4
Wired Networks Thread, linux router to connect kindle to proxy server in Technical; Common probably and I'm sure I've solved this before at another school but for the life of me can't figure ...
  1. #1
    tmcd0035's Avatar
    Join Date
    Feb 2012
    Location
    Norwich
    Posts
    17
    Thank Post
    1
    Thanked 1 Time in 1 Post
    Rep Power
    0

    linux router to connect kindle to proxy server

    Common probably and I'm sure I've solved this before at another school but for the life of me can't figure it out this time!

    We have a private IP range routed on to our County's larger private IP range. Web request go through an onsite proxy server on port 1080 and are then forwarded to another Countywide proxy server before reaching the wider Internet.

    We are looking at investing in either Kindles or Android tablets and are having problems with entering proxy settings, or the lack of support for these settings.

    So the solution is to set up a router on our network to route traffic from a new private range onto our existing private range and in the process transparently redirect port 80 requests to our proxy server.

    Hopefully that makes sense.

    Here's what I've done:

    Set up a Hyper-V virtual machine with two NICs and installed CentOS 6.1 i386 minimal. Eth0 is on our existing range (10.96.22.100) and eth1 is on the new range (172.16.20.1)

    Here are router setting's I've tried:
    Code:
    #/etc/rc.local
    modprobe ip_conntrack
    modprobe iptable_nat
    
    #/etc/sysctl.conf
    echo 1 > /proc/sys/net/ipv4/ip_forward
    
    #iptables
    iptables --flush
    iptables -t nat --flush
    iptables --delete-chains
    iptables -t nat --delete-chains
    
    iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
    iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
    
    iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j DNAT --to 10.96.22.5:1080
    iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
    
    iptables-save > /etc/sysconfig/iptables
    service iptables stop
    service iptables start
    chkconfig iptables on
    service iptables status
    On the Kindle, the Android tab and my iPhone I've tried the following settings
    Code:
    Static IP: 172.16.20.5
    Netmask:  255.255.0.0
    Gateway:  172.16.20.1
    DNS:        10.96.22.11
    Can anyone point me in the right direction to get this working?

    Thanks

    Terry.

  2. #2
    browolf's Avatar
    Join Date
    Jun 2005
    Location
    Mars
    Posts
    1,524
    Thank Post
    106
    Thanked 88 Times in 74 Posts
    Blog Entries
    46
    Rep Power
    40
    Not sure if this helps but
    the iptables transparency command we use is

    -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128

    but what we've done is make a separate transparent proxy that handles guest wireless and everything: iptables, squid, dns, dhcp is on one box so it's an isolated system. the two lan cards one is vlan for guest wireless, the other plugs into the router than connects to county.

  3. Thanks to browolf from:

    tmcd0035 (2nd February 2012)

  4. #3
    tmcd0035's Avatar
    Join Date
    Feb 2012
    Location
    Norwich
    Posts
    17
    Thank Post
    1
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by browolf View Post

    -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
    The problem with that is it redirects the port but there is no mention of where the proxy server is.

    can i do something like

    Code:
     REDIRECT --to 10.96.22.5 --to-ports 1080
    ?

    I can't help feeling I'm missing something obvious in my original script.

  5. #4
    browolf's Avatar
    Join Date
    Jun 2005
    Location
    Mars
    Posts
    1,524
    Thank Post
    106
    Thanked 88 Times in 74 Posts
    Blog Entries
    46
    Rep Power
    40
    In our case it assumes the proxy is on the same machine. which is it.

    if we had the proxy on another machine we'd do it in the form

    iptables -t nat -A PREROUTING -p PROTO -d DEST_IP --dport DEST_PORT
    -j REDIRECT --to-ports LOCAL_PORTS

    this page looks relevant to your issues: http://www.karlrupp.net/en/computer/nat_tutorial

    i'd forget the transparency to begin with and get it working with a laptop
    Last edited by browolf; 2nd February 2012 at 12:22 PM.

SHARE:
+ Post New Thread

Similar Threads

  1. Might be usefull - connect Mac, Unix & Linux to windows server AD
    By sharkster in forum How do you do....it?
    Replies: 0
    Last Post: 2nd November 2009, 02:00 PM
  2. [MS Office - 2003] Outlook - User can not connect to exchange server
    By Tony_Mc in forum Office Software
    Replies: 2
    Last Post: 26th January 2009, 02:38 PM
  3. Connect to Windows Server
    By TechSupp in forum *nix
    Replies: 2
    Last Post: 15th December 2008, 11:06 AM
  4. Log When Laptops Connect to The Server
    By nawbus in forum Network and Classroom Management
    Replies: 1
    Last Post: 11th July 2008, 12:48 PM
  5. Replies: 0
    Last Post: 27th February 2008, 01:42 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •