Add static route on Mac OSX and Windows

Add static route on windows is very easy. Run command prompt as Administrator.

route -p add 10.10.120.0 mask 255.255.255.0 192.168.0.1

Add static route on OS x, need the following steps

  1. Find the network service which can access gateway
    mac-mini:~ ladmin$ networksetup -listallnetworkservices
    An asterisk (*) denotes that a network service is disabled.
    Internet
    LAN
    Backup-LAN
    Bluetooth DUN
    *FireWire
    *Bluetooth PAN 2
    Wi-Fi
     
    mac-mini:~ ladmin$ networksetup -getinfo LAN
    Manual Configuration
    IP address: 192.168.15.2
    Subnet mask: 255.255.255.0
    Router: 192.168.15.254
    IPv6: Automatic
    IPv6 IP address: none
    IPv6 Router: none
    Ethernet Address: 00:1f:5b:33:1d:75
  2. set additional gateway on the network service
    mac-mini:~ ladmin$ sudo networksetup -setadditionalroutes LAN 10.0.0.0 255.255.255.0 192.168.15.254
    Password:
    mac-mini:~ ladmin$ networksetup -getadditionalroutes LAN
    10.0.0.0 255.255.255.0 192.168.15.254
  3. Check the route list

    mac-mini:~ ladmin$ netstat -rn
    Routing tables
     
    Internet:
    Destination        Gateway            Flags        Refs      Use   Netif Expire
    default            213.125.227.185    UGSc           18        0   vlan0
    default            192.168.15.254     UGScI           0        0     en0
    default            192.168.15.254     UGScI           0        0     en1
    default            192.168.15.254     UGScI           0        0     en2
    10/24              192.168.15.254     UGSc            0        0     en1
    127                127.0.0.1          UCS             0        0     lo0
    127.0.0.1          127.0.0.1          UH             75  2330825     lo0
    169.254            link#8             UCS             1        0   vlan0
    169.254            link#4             UCSI            0        0     en0
    169.254            link#5             UCSI            0        0     en1
    

    Add more routing paths:

    iso@isoAir:/dev$ sudo networksetup -setadditionalroutes “Ethernet Pantalla Trabajo” 10.0.0.0 255.0.0.0 10.1.36.1 172.16.0.0 255.240.0.0 10.1.36.1 192.168.0.0 255.255.0.0 10.1.36.1
    iso@isoAir:/dev$ sudo networksetup -getadditionalroutes “Ethernet Pantalla Trabajo”
    10.0.0.0 255.0.0.0 10.1.36.1
    172.16.0.0 255.240.0.0 10.1.36.1
    192.168.0.0 255.255.0.0 10.1.36.1
    

    reference:

    http://www.marcoach.nl/persistent-static-routes-on-os-x/

    https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_tcpip_pro_addstaticroute.mspx?mfr=true

Mac OSX “Hold for authentication” when trying to print

Fix steps:

  1. Print any document and the job is hold in queue with message “Hold for authentication”
  2. Open a terminal window and run the following commands
    $ lpstat -s
    

    Output likes the following:
    device for <printer name>: smb://<server>/<shared name>

    device for Canon_iR_ADV_4245: smb://my-windows-printer-server/Canon_iR_ADV_4245
    
    $ sudo lpadmin -p <printer name> -o auth-info-required=<Your username>,<Your password>
    

Reference: http://servalpaul.blogspot.com/2015/01/mac-osx-hold-for-authentication-when.html