xref: /curl/docs/cmdline-opts/interface.md (revision 68680ba5)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Long: interface
5Arg: <name>
6Help: Use network interface
7Category: connection
8Added: 7.3
9Multi: single
10See-also:
11  - dns-interface
12Example:
13  - --interface eth0 $URL
14  - --interface "host!10.0.0.1" $URL
15  - --interface "if!enp3s0" $URL
16---
17
18# `--interface`
19
20Perform the operation using a specified interface. You can enter interface
21name, IP address or hostname. If you prefer to be specific, you can use the
22following special syntax:
23
24## if!<name>
25
26Interface name. If the provided name does not match an existing interface,
27curl returns with error 45.
28
29## host!<name>
30
31IP address or hostname.
32
33## ifhost!<interface>!<host>
34
35Interface name and IP address or hostname. This syntax requires libcurl 8.9.0
36or later.
37
38If the provided name does not match an existing interface, curl returns with
39error 45.
40
41##
42
43curl does not support using network interface names for this option on
44Windows.
45
46That name resolve operation if a hostname is provided does **not** use
47DNS-over-HTTPS even if --doh-url is set.
48
49On Linux this option can be used to specify a **VRF** (Virtual Routing and
50Forwarding) device, but the binary then needs to either have the
51**CAP_NET_RAW** capability set or to be run as root.
52