xref: /aosp_15_r20/external/curl/docs/cmdline-opts/interface.md (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker---
2*6236dae4SAndroid Build Coastguard Workerc: Copyright (C) Daniel Stenberg, <[email protected]>, et al.
3*6236dae4SAndroid Build Coastguard WorkerSPDX-License-Identifier: curl
4*6236dae4SAndroid Build Coastguard WorkerLong: interface
5*6236dae4SAndroid Build Coastguard WorkerArg: <name>
6*6236dae4SAndroid Build Coastguard WorkerHelp: Use network interface
7*6236dae4SAndroid Build Coastguard WorkerCategory: connection
8*6236dae4SAndroid Build Coastguard WorkerAdded: 7.3
9*6236dae4SAndroid Build Coastguard WorkerMulti: single
10*6236dae4SAndroid Build Coastguard WorkerSee-also:
11*6236dae4SAndroid Build Coastguard Worker  - dns-interface
12*6236dae4SAndroid Build Coastguard WorkerExample:
13*6236dae4SAndroid Build Coastguard Worker  - --interface eth0 $URL
14*6236dae4SAndroid Build Coastguard Worker  - --interface "host!10.0.0.1" $URL
15*6236dae4SAndroid Build Coastguard Worker  - --interface "if!enp3s0" $URL
16*6236dae4SAndroid Build Coastguard Worker---
17*6236dae4SAndroid Build Coastguard Worker
18*6236dae4SAndroid Build Coastguard Worker# `--interface`
19*6236dae4SAndroid Build Coastguard Worker
20*6236dae4SAndroid Build Coastguard WorkerPerform the operation using a specified interface. You can enter interface
21*6236dae4SAndroid Build Coastguard Workername, IP address or hostname. If you prefer to be specific, you can use the
22*6236dae4SAndroid Build Coastguard Workerfollowing special syntax:
23*6236dae4SAndroid Build Coastguard Worker
24*6236dae4SAndroid Build Coastguard Worker## if!<name>
25*6236dae4SAndroid Build Coastguard Worker
26*6236dae4SAndroid Build Coastguard WorkerInterface name. If the provided name does not match an existing interface,
27*6236dae4SAndroid Build Coastguard Workercurl returns with error 45.
28*6236dae4SAndroid Build Coastguard Worker
29*6236dae4SAndroid Build Coastguard Worker## host!<name>
30*6236dae4SAndroid Build Coastguard Worker
31*6236dae4SAndroid Build Coastguard WorkerIP address or hostname.
32*6236dae4SAndroid Build Coastguard Worker
33*6236dae4SAndroid Build Coastguard Worker## ifhost!<interface>!<host>
34*6236dae4SAndroid Build Coastguard Worker
35*6236dae4SAndroid Build Coastguard WorkerInterface name and IP address or hostname. This syntax requires libcurl 8.9.0
36*6236dae4SAndroid Build Coastguard Workeror later.
37*6236dae4SAndroid Build Coastguard Worker
38*6236dae4SAndroid Build Coastguard WorkerIf the provided name does not match an existing interface, curl returns with
39*6236dae4SAndroid Build Coastguard Workererror 45.
40*6236dae4SAndroid Build Coastguard Worker
41*6236dae4SAndroid Build Coastguard Worker##
42*6236dae4SAndroid Build Coastguard Worker
43*6236dae4SAndroid Build Coastguard Workercurl does not support using network interface names for this option on
44*6236dae4SAndroid Build Coastguard WorkerWindows.
45*6236dae4SAndroid Build Coastguard Worker
46*6236dae4SAndroid Build Coastguard WorkerThat name resolve operation if a hostname is provided does **not** use
47*6236dae4SAndroid Build Coastguard WorkerDNS-over-HTTPS even if --doh-url is set.
48*6236dae4SAndroid Build Coastguard Worker
49*6236dae4SAndroid Build Coastguard WorkerOn Linux this option can be used to specify a **VRF** (Virtual Routing and
50*6236dae4SAndroid Build Coastguard WorkerForwarding) device, but the binary then needs to either have the
51*6236dae4SAndroid Build Coastguard Worker**CAP_NET_RAW** capability set or to be run as root.
52