Force network interface for safari

Discussion in 'Mac Basics and Help' started by razrburn, Aug 6, 2007.

  1. razrburn macrumors newbie

    Joined:
    Aug 6, 2007
    #1
    I have been wondering if there is a way to for safari to use a specific interface. here is my situation. I have my ethernet hardwired in and my wireless connected to two different networks I would like safari to be force to use my bluetooth one since that is completely private (I have a data-plan on my phone to use as a modem). but there are other resources on the other network (ethernet) that I need to be able to access at the same time. such as shared drives and other stuff. I don't want to use the ethernet for web browsing. does anyone know if this is possible?
     
  2. tyr2 macrumors 6502a

    tyr2

    Joined:
    May 6, 2006
    Location:
    Leeds, UK
    #2
    It's pretty much down to the routes you have on the box. Open the terminal and do 'netstat -rn' and you'll see something like this:

    Code:
    Internet:
    Destination        Gateway            Flags    Refs      Use  Netif Expire
    default            192.168.0.1        UGSc       50       11    en0
    127                127.0.0.1          UCS         0        0    lo0
    127.0.0.1          127.0.0.1          UH         13    21107    lo0
    169.254            link#4             UCS         0        0    en0
    192.168.0          link#4             UCS         3        0    en0
    192.168.0.1        0:14:bf:xx:xx:xx   UHLW       50        2    en0   1174
    192.168.0.10       0:d:b:xx:xx:xx     UHLW        0      120    en0    904
    192.168.0.104      127.0.0.1          UHS         0        4    lo0
    192.168.0.255      link#4             UHLWb       3      110    en0
    
    You'll have additional routes for each network. The 'default' route at the top will be the route used to get out to the public internet.

    You can change the default route to be your bluetooth network as long as you know what the address for the router is.

    Add a new default route like this

    route add default the.blootouth.ip.address

    Then delete the old route

    route delete default the.old.gateway.ip

    You will still be able to connect to stuff on your local network, providing it is on the same subnet, if it isn't you'll need to add specific routes for other networks.

    If you want this to persist across a reboot you'll probably need to do something with NetInfo but I'm not sure what.
     

Share This Page