Set route command
In Mac OS X, the commands for setting up routes are slightly different:
The code is as follows |
Copy Code |
Route-n Add Defalut 10.13.31.1 Route-n add-net 10.0.0.0/8 10.13.31.1 Route-n add-net 210.32.0.0/20 10.13.31.1 Route-n add-net 222.205.0.0/17 10.13.31.1 |
Prompt routing exists can be deleted by the following method and then added
The code is as follows |
Copy Code |
Route-n Delete Defalut 10.13.31.1 |
View routes (route)
Very simply, a command can be viewed
The code is as follows |
Copy Code |
Netstat–nr |
Setting DNS Commands
The code is as follows |
Copy Code |
Networksetup-listallnetworkservices |
Get all interfaces (interfaces).
The code is as follows |
Copy Code |
networksetup-setdnsservers {INTERFACE NAME} {YOUR DNS SERVER} |
Set up DNS.
The code is as follows |
Copy Code |
networksetup-setdnsservers {INTERFACE NAME} {YOUR DNS server} {YOUR DNS server} |
If you have more than one DNS, separate them with spaces.
You can then use Ifconfig to view the changes.
Never found the MAC command line configuration DNS method
Today's special discovery, recorded:
List all network connection modes
The code is as follows |
Copy Code |
Networksetup-listallnetworkservices |
Sets the DNS server for the specified network connection mode
The code is as follows |
Copy Code |
sudo networksetup-setdnsservers AirPort 192.168.10.200 |
Emptying the DNS cache
code is as follows |
copy code |
Dscacheutil –flushcache |