[tor-relays] obfs4 bridge current setup is not entirely clear

Hi,

I ran into some new IP space and I decided to change a cluster of obfs4 bridges that are more than 4 year old. When I set them up I don't remember spending so much time.

So, Debian latest and Tor latest from deb.torproject.org nightly.

GoLang from the official website (as it's the latest version) and obfs4proxy cloned from its default git repository.

1. The page at Tor Project | Debian / Ubuntu needs a small revision.

This page must be changed, for Debian it doesn't work simply $ edit tor@.service tor@default.service , change to NoNewPrivileges=no, save and quit.

For me it only worked by editing
/lib/systemd/system/tor@.service and /lib/systemd/system/tor@default.service with NoNewPrivileges=no and then:

$ sudo systemctl daemon-reload.

Setcap command is ok but it also need to mention to install the package in Debian libcap2-bin as well as an additional step:

Under Debian, if obfs4proxy is installed in a different place, for example like in its git documentation /usr/local/bin/obfs4proxy then you also need to edit this file:

/etc/apparmor.d/abstractions/tor

and add one line (or change the default obfs4proxy line to):

   /usr/local/bin/obfs4proxy Pix,

Substitute path if different and then:
$ sudo systemctl restart apparmor.

···

------------------------------------------------

2. It was recommended on the mail list that obfs4 bridges should not open their ORPorts publicly to prevent scanning the entire 1-65536 port range and determine it's a Tor bridge. OK.

But if you try:

ORPort 127.0.0.1:auto
ORPort [::1]:auto
AssumeReachable 1 # needed to skip ORPort reachability test

Tor will start but it will constantly complain in the log with:

[warn] The IPv4 ORPort address 127.0.0.1 does not match the descriptor address REAL_IPv4_ADDRESS. If you have a static public IPv4 address, use 'Address <IPv4>' and 'OutboundBindAddress <IPv4>'. If you are behind a NAT, use two ORPort lines: 'ORPort <PublicPort> NoListen' and 'ORPort <InternalPort> NoAdvertise'.

[warn] The IPv6 ORPort address ::1 does not match the descriptor address REAL_IPv6_ADDRESS. If you have a static public IPv4 address, use 'Address <IPv6>' and 'OutboundBindAddress <IPv6>'. If you are behind a NAT, use two ORPort lines: 'ORPort <PublicPort> NoListen' and 'ORPort <InternalPort> NoAdvertise'.

I guess it's OK to continue to run it even with this as I do understand the log messages and it's the desired effect, but isn't it confusing for less experienced users? They might think something is wrong when it is not.

The recommended way is to add a simple logic to skip that check, because we can't remove it, it's vital necessary for relays (not bridges) behind NAT or dynDNS or whatever. So if BridgeRelay 1 is set and $some_transport enabled, ignore the ORPort and descriptor check / log. and instead check the pluggable transport if port open and listening.

Or even better, code a pluggable transport port reachability test before building and uploading the descriptor, by cloning the code that does this for ORPorts to the pluggable transport ports. This would need a proposal that covers all use cases.

3. ServerTransportListenAddr can be used just once and it's difficult for dual-stack which is now the vast majority.

It's known for many years that each pluggable transport supports just one ServerTransportListenAddr line, the second one is simply ignored. Tickets for this exist.

So what is the best way to for an user to open both IPv4 and IPv6 pluggable transport ports?

In Debian I have achieved it by using as wildcard ServerTransportListenAddr [::]:80 since the wildcard [::] under Debian binds to all IPv4 and IPv6 addresses on all interfaces, but this might not be the same for all operating systems.

Also, how does BridgeDB determine in case wildcard [::] is used if the pluggable transport is IPv4, IPv6 or both? Which one is used when BridgeDB sends this bridge to clients?

2. It was recommended on the mail list that obfs4 bridges should not
open their ORPorts publicly to prevent scanning the entire 1-65536 port
range and determine it's a Tor bridge. OK.

Not recommended, but rather a request to try it out.

Some info in the old thread
https://lists.torproject.org/pipermail/tor-relays/2023-August/021259.html

Relevant tiket from meskio:

But if you try:

ORPort 127.0.0.1:auto
ORPort [::1]:auto
AssumeReachable 1 # needed to skip ORPort reachability test

Tor will start but it will constantly complain in the log with:

[warn] The IPv4 ORPort address 127.0.0.1 does not match the descriptor
address REAL_IPv4_ADDRESS. If you have a static public IPv4 address, use
'Address <IPv4>' and 'OutboundBindAddress <IPv4>'. If you are behind a
NAT, use two ORPort lines: 'ORPort <PublicPort> NoListen' and 'ORPort
<InternalPort> NoAdvertise'.

[warn] The IPv6 ORPort address ::1 does not match the descriptor address
REAL_IPv6_ADDRESS. If you have a static public IPv4 address, use
'Address <IPv6>' and 'OutboundBindAddress <IPv6>'. If you are behind a
NAT, use two ORPort lines: 'ORPort <PublicPort> NoListen' and 'ORPort
<InternalPort> NoAdvertise'.

Yes you can ignore the logs. Not exposing OrPort for bridges is still
experimental feature.

I've gradually reconfigured _all_ bridges over the last 2 months:
The number of connections/users has stayed pretty much the same.
Bridges with setting "BridgeDistribution any" the distribution method has not
changed.

OrPort must forwarded or should not firewalled otherwise the status will be
dysfunctional on https://bridges.torproject.org/status

So what is the best way to for an user to open both IPv4 and IPv6
pluggable transport ports?

The ServerTransportListenAddr line is dual stack friendly.
ServerTransportListenAddr obfs4 [::]:8443

···

On Mittwoch, 8. November 2023 17:42:46 CET s7r wrote:

--
╰_╯ Ciao Marco!

Debian GNU/Linux

It's free software and it gives you freedom!

boldsuck wrote:

Not recommended, but rather a request to try it out.

So I tried, and besides the log messages that I have a descriptor mismatch I also get the status of my bridge as not running when ORPort is not exposed. The minute I switched ORPort to `localhost` the BridgeDB reported the bridge as not running, regardless it was actually running with the pluggable transport port open.

Some info in the old thread
[tor-relays] Help Turkmens to bypass Internet censorship: run an obfs4 bridge!

Relevant tiket from meskio:
Recommend not exposing OrPort for bridges (#129) · Issues · The Tor Project / Anti-censorship / Team · GitLab

Thank you, yes.
But unfortunately I think we are going to need a proposal for this, to document various use cases and maybe clone the code that does the ORPort reachability check to do pluggable transport port reachability test, then build descriptor and then publish, but this needs ORPort like behavior like NoListen, etc.

[warn] The IPv6 ORPort address ::1 does not match the descriptor address
REAL_IPv6_ADDRESS. If you have a static public IPv4 address, use
'Address <IPv6>' and 'OutboundBindAddress <IPv6>'. If you are behind a
NAT, use two ORPort lines: 'ORPort <PublicPort> NoListen' and 'ORPort
<InternalPort> NoAdvertise'.

Yes you can ignore the logs. Not exposing OrPort for bridges is still
experimental feature.

I've gradually reconfigured _all_ bridges over the last 2 months:
The number of connections/users has stayed pretty much the same.
Bridges with setting "BridgeDistribution any" the distribution method has not
changed.

OrPort must forwarded or should not firewalled otherwise the status will be
dysfunctional on https://bridges.torproject.org/status

I don't care to use BridgeDistribution param, I let BridgeDB decide this randomly but configured without public open ORPort I don't get the running flag, I get that bridge is down, while it's not actually.

So what is the best way to for an user to open both IPv4 and IPv6
pluggable transport ports?

The ServerTransportListenAddr line is dual stack friendly.
ServerTransportListenAddr obfs4 [::]:8443

So I saw yes, I was able to use [::]:80 to bind to all interfaces in dual stack mode but I am not sure the clients are served both the IPv6 line and the IPv4 line, I think it's just one of them and I was curious which one and what logic is applied to determine it.

This means that currently one cannot setup a dual stack pluggable transport bridge, it must be either IPv4 either IPv6, right?

boldsuck wrote:

>
> Not recommended, but rather a request to try it out.
>

So I tried, and besides the log messages that I have a descriptor
mismatch I also get the status of my bridge as not running when ORPort
is not exposed. The minute I switched ORPort to `localhost` the BridgeDB
reported the bridge as not running, regardless it was actually running
with the pluggable transport port open.

That is unfortunately the case. I checked whether they are online at:
https://bridges.torproject.org/status?id=[hashed_identity_key]
On Tor metrics you can also see that the history continues.

> Some info in the old thread
> [tor-relays] Help Turkmens to bypass Internet censorship: run an obfs4 bridge!
>
> Relevant tiket from meskio:
> Recommend not exposing OrPort for bridges (#129) · Issues · The Tor Project / Anti-censorship / Team · GitLab
>

Thank you, yes.
But unfortunately I think we are going to need a proposal for this, to
document various use cases and maybe clone the code that does the ORPort
reachability check to do pluggable transport port reachability test,
then build descriptor and then publish, but this needs ORPort like
behavior like NoListen, etc.

That'd be good

> I've gradually reconfigured _all_ bridges over the last 2 months:
> The number of connections/users has stayed pretty much the same.
> Bridges with setting "BridgeDistribution any" the distribution method has
> not changed.
>
> OrPort must forwarded or should not firewalled otherwise the status will
> be dysfunctional on https://bridges.torproject.org/status
>

I don't care to use BridgeDistribution param, I let BridgeDB decide this
randomly

Me too. "BridgeDistribution any" is tor default setting.

but configured without public open ORPort I don't get the
running flag, I get that bridge is down, while it's not actually.

>> So what is the best way to for an user to open both IPv4 and IPv6
>> pluggable transport ports?
>
>
> The ServerTransportListenAddr line is dual stack friendly.
> ServerTransportListenAddr obfs4 [::]:8443
>

So I saw yes, I was able to use [::]:80 to bind to all interfaces in
dual stack mode but I am not sure the clients are served both the IPv6
line and the IPv4 line, I think it's just one of them and I was curious
which one and what logic is applied to determine it.
This means that currently one cannot setup a dual stack pluggable
transport bridge, it must be either IPv4 either IPv6, right?

If I use my dual stack bridges with TorBrowser or HS clients, I can use IP and IPv6.

2023-11-08 21:15:20.815 [NOTICE] Bridge 'ForPrivacyNET' has both an IPv4 and an IPv6 address. Will prefer using its IPv6 address ([2001:db8:1::228]:11228) based on the configured Bridge address.
2023-11-08 21:15:21.712 [NOTICE] Bridge 'ForPrivacyNET' has both an IPv4 and an IPv6 address. Will prefer using its IPv4 address (203.0.113.228:11228) based on the configured Bridge address.

···

On Mittwoch, 8. November 2023 20:35:56 CET s7r wrote:

--
╰_╯ Ciao Marco!

Debian GNU/Linux

It's free software and it gives you freedom!

Quoting s7r (2023-11-08 17:42:46)

1. The page at
Tor Project | Debian / Ubuntu needs a
small revision.

Feel free to send a merge request to improve it:

2. It was recommended on the mail list that obfs4 bridges should not open
their ORPorts publicly to prevent scanning the entire 1-65536 port range and
determine it's a Tor bridge. OK.

But if you try:

ORPort 127.0.0.1:auto
ORPort [::1]:auto
AssumeReachable 1 # needed to skip ORPort reachability test

Tor will start but it will constantly complain in the log with:

[warn] The IPv4 ORPort address 127.0.0.1 does not match the descriptor
address REAL_IPv4_ADDRESS. If you have a static public IPv4 address, use
'Address <IPv4>' and 'OutboundBindAddress <IPv4>'. If you are behind a
NAT, use two ORPort lines: 'ORPort <PublicPort> NoListen' and 'ORPort
<InternalPort> NoAdvertise'.

[warn] The IPv6 ORPort address ::1 does not match the descriptor address
REAL_IPv6_ADDRESS. If you have a static public IPv4 address, use
'Address <IPv6>' and 'OutboundBindAddress <IPv6>'. If you are behind a
NAT, use two ORPort lines: 'ORPort <PublicPort> NoListen' and 'ORPort
<InternalPort> NoAdvertise'.

I guess it's OK to continue to run it even with this as I do understand
the log messages and it's the desired effect, but isn't it confusing for
less experienced users? They might think something is wrong when it is not.

We are still working on supporting no publishing the ORPort. Is not bad to do
it, but there are some quircks that we need to fix.

3. ServerTransportListenAddr can be used just once and it's difficult for
dual-stack which is now the vast majority.

It's known for many years that each pluggable transport supports just
one ServerTransportListenAddr line, the second one is simply ignored.
Tickets for this exist.

So what is the best way to for an user to open both IPv4 and IPv6
pluggable transport ports?

This is not currently supported, but there is some work done in that direction:

.

···

--
meskio | https://meskio.net/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
My contact info: https://meskio.net/crypto.txt
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Nos vamos a Croatan.
_______________________________________________
tor-relays mailing list
tor-relays@lists.torproject.org
tor-relays Info Page