You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- reduce number of actions done to create/configure the interface in the system
- assign synthetic static link-local ip address to the interface, that is required by the OS to just be available for routing
- make tun_darwin_endpoint be implemented significantly more similar to tun_windows_enpoint, preparing them for potential unification
Copy file name to clipboardExpand all lines: proxy/tun/README.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ TUN interface support bridges the gap between network layer 3 and layer 7, intro
4
4
5
5
This functionality is targeted to assist applications/end devices that don't have proxy support, or can't run external applications (like Smart TV's). Making it possible to run Xray proxy right on network edge devices (routers) with support to route raw network traffic. \
6
6
Primary targets are Linux based router devices. Like most popular OpenWRT option. \
7
-
Although support for Windows is also implemented (see below).
7
+
Although support for Windows/MacOSX is also implemented (see below).
Despite Windows also giving the adapter autoconfigured ipv6 address, the ipv6 is not possible until the interface has any _routable_ ipv6 address (given link-local address will not accept traffic from external addresses). \
174
174
So everything applicable for ipv4 above also works for ipv6, you only need to give the interface some address manually, e.g. anything private like fc00::a:b:c:d/64 will do just fine
175
+
176
+
## MAC OS X SUPPORT
177
+
178
+
Darwin (Mac OS X) support of the same functionality is implemented through utun (userspace tunnel).
179
+
180
+
Interface name in the configuration must comply to the scheme "utunN", where N is some number. \
181
+
Most running OS'es create some amount of utun interfaces in advance for own needs. Please either check the interfaces you already have occupied by issuing following command:
182
+
```
183
+
ifconfig
184
+
```
185
+
Produced list will have all system interfaces listed, from which you will see how many "utun" ones already exists.
186
+
It's not required to select next available number, e.g. if you have utun1-utun7 interfaces, it's not required to have "utun8" in the config. You can choose any available name, even utun20, to get surely available interface number.
187
+
188
+
To attach routing to the interface, route command like following can be executed:
189
+
```
190
+
sudo route add -net 1.1.1.0/24 -iface utun10
191
+
```
192
+
Important to remember that everything written above about Linux routing concept, also apply to Mac OS X. If you simply route default route through utun interface, that will result network loop and immediate network failure.
0 commit comments