Last active
May 29, 2018 05:45
-
-
Save anjannath/8251649936e29b5d295cca7ce107ffc6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In disconnected state macOS doesnot make dns requests.. so we need to make a tap device assign it an ip so that it thinks it is still connected to something, | |
after that the resolver file inside /etc/resolver/nip.io will be used for the resolving so we only need to ccreate a tap device and that's it. | |
1. Install the `tuntap` package from brew | |
2. Create a network service using the tap device.. need to edit the file in /Library/Preferences/SystemConfiguration/preferences.plist | |
add the following snippet to that file, under _NetworkServices_ key need to generate a uuid (`uuidgen`) | |
``` | |
<key>D16F22CE-6DDE-4E63-837C-E16538EA5CCB</key> <-- uuid | |
<dict> | |
<key>DNS</key> | |
<dict/> | |
<key>IPv4</key> | |
<dict> | |
<key>Addresses</key> | |
<array> | |
<string>10.10.90.1</string> | |
</array> | |
<key>ConfigMethod</key> | |
<string>Manual</string> | |
<key>SubnetMasks</key> | |
<array> | |
<string>255.255.0.0</string> | |
</array> | |
</dict> | |
<key>IPv6</key> | |
<dict> | |
<key>ConfigMethod</key> | |
<string>Automatic</string> | |
</dict> | |
<key>Interface</key> | |
<dict> | |
<key>DeviceName</key> | |
<string>tap0</string> | |
<key>Hardware</key> | |
<string>Ethernet</string> | |
<key>Type</key> | |
<string>Ethernet</string> | |
<key>UserDefinedName</key> | |
<string>MiniTap</string> | |
</dict> | |
<key>Proxies</key> | |
<dict> | |
<key>ExceptionsList</key> | |
<array> | |
<string>*.local</string> | |
<string>169.254/16</string> | |
</array> | |
<key>FTPPassive</key> | |
<integer>1</integer> | |
</dict> | |
<key>SMB</key> | |
<dict/> | |
<key>UserDefinedName</key> | |
<string>MiniTap</string> | |
</dict> | |
</dict> | |
``` | |
now we need to make two more entries in that file, one to the list of service order.. look for the key _Sets_ and under that look for the key _ServiceOrder_ | |
add the uuid for MiniTap there.. | |
next entry looks like the following and goes under the _Service_ key, (replace the uuid with the generated one) | |
``` | |
<dict> | |
<key>__LINK__</key> | |
<string>/NetworkServices/D16F22CE-6DDE-4E63-837C-E16538EA5CCB</string> | |
</dict> | |
``` | |
run the following commands.. as root (assiging ip to the tap device and turn it on) | |
exec 4<>/dev/tap0 <-- this opens and closes the device i guess.. | |
ifconfig tap0 10.10.90.1 255.255.0.0 | |
ifconfig tap0 up | |
now set the same ip address for the MiniTap interface from the network preferences gui.. | |
and it should work.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment