Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interface.md: expand on --interface use #517

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions usingcurl/connections/interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,19 @@ would like to "bind" your local end of the communication to, with the

curl --interface machine2 https://www.example.com/

We discourage use of a hostname in there, because how that forces curl to do a
name resolve to figure out an IP address. If you cannot specify an interface
name, consider using a fixed IP address.

In addition, you can ask to explicitly use and IP address or interface name to
prevent curl from having to guess. Do this by prefix the string with `if!` for
interface name or `host!` for an IP address. Like this:

curl --interface "host!192.168.0.2" https://www.example.com/

curl --interface "if!eth1" https://www.example.com/

You can even specify a specific IP and on a specific interface by providing
both like this:

curl --interface "if!eith1!192.168.0.2" https://www.example.com/
Loading