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

ddns-scripts: Get 'l3 device' (for pppoe connection) for bind_network using curl #14431

Closed
wants to merge 1 commit into from

Conversation

welderpb
Copy link

@welderpb welderpb commented Jan 7, 2021

Maintainer: none
Compile tested: mips_24kc
Run tested: mips_24kc, REVISION 'r15449-936220186d'

Description:
ddns is not working for ipv4, if pppoe is used for wan access. script set 'eth1'
as interface for curl in my case. The correct interface is 'pppoe-wan'.
script uses 'network_get_physdev' function to get real device for bind_network.. So this pull request change function to 'network_get_device'. In case if we don't use pppoe connection - 'l3 device' is equal to real device.
in my case:
root@OpenWrt:~# ifstatus wan
{
"up": true,
"pending": false,
"available": true,
"autostart": true,
"dynamic": false,
"uptime": 8914,
"l3_device": "pppoe-wan",
"proto": "pppoe",
"device": "eth1",
......

Signed-off-by: Pavel Bukhatkin welder_pb@bk.ru

@jow-
Copy link
Contributor

jow- commented Jan 7, 2021

You should adjust the error log message as well, it still mentions network_get_physdev

@welderpb
Copy link
Author

welderpb commented Jan 8, 2021

provider ydns.io
ddns config:

        option enabled '1'
        option domain 'xxx.ydns.eu'
        option username 'kY6yVgVwddlWWXUZDX'
        option password 'ZZZZZZZZZZXXXXXXXXXYYYYYYYY'
        option interface 'wan'
        option ip_source 'network'
        option ip_network 'wan'
        option use_https '1'
        option update_url 'https://[USERNAME]:[PASSWORD]@ydns.io/api/v1/update/?host=[DOMAIN]&ip=[IP]'
        option lookup_host 'xxx.ydns.eu'

wan config:

	option ifname 'eth1'
	option _orig_ifname 'eth1'
	option _orig_bridge 'false'
	option proto 'pppoe'
	option username 'xxxyyyzzz'
	option password '123'

default behavior with curl:
145335 : Local IP 'xx.161.121.166' detected on network 'wan'
145335 : Update needed - L: 'xx.161.121.166' <> R: 'xx.161.121.161'
145336 : Force communication via device 'eth1'
145336 : #> /usr/bin/curl -RsS -o /var/run/ddns/ydns.dat --stderr /var/run/ddns/ydns.err --interface eth1 --noproxy '*' 'https://kY6yVgVwddlWWXUZDX:***PW***@ydns.io
/api/v1/update/?host=xxx.ydns.eu&ip=xx.161.121.166'
145545 ERROR : cURL Error: '28'
145545 : curl: (28) Failed to connect to ydns.io port 443: Operation timed out

when PR is applied:
145752 : Update needed - L: 'xx.161.121.166' <> R: 'xx.161.121.161'
145752 : Force communication via device 'pppoe-wan'
145752 : #> /usr/bin/curl -RsS -o /var/run/ddns/ydns.dat --stderr /var/run/ddns/ydns.err --interface pppoe-wan --noproxy '*' 'https://kY6yVgVwddlWWXUZDX:***PW***@yd
ns.io/api/v1/update/?host=xxx.ydns.eu&ip=xx.161.121.166'
145753 : DDNS Provider answered:
ok

So, we can see curl is used right interface pppoe-wan as bind interface with patch applied.

feckert added a commit that referenced this pull request Jun 22, 2021
If pppoe is used for wan access. script set 'eth1' as interface for curl
call. The correct interface is however 'pppoe-wan'.

The script uses 'network_get_physdev' function to get real device for
bind_network but this is wrong. We need instead the l3_device of the the
logical interface.

In case if we don't use pppoe connection - 'l3_device' is equal to real device.

This was reported by the github user `welderpb` with P/R:
 #14431

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
@feckert
Copy link
Member

feckert commented Jun 22, 2021

@welderpb thanks for reporting and staging this pullrequest. I have pushed this to master with 036079b and changed also the logging message as requested.

@feckert feckert closed this Jun 22, 2021
feckert added a commit that referenced this pull request Jun 22, 2021
If pppoe is used for wan access. script set 'eth1' as interface for curl
call. The correct interface is however 'pppoe-wan'.

The script uses 'network_get_physdev' function to get real device for
bind_network but this is wrong. We need instead the l3_device of the the
logical interface.

In case if we don't use pppoe connection - 'l3_device' is equal to real device.

This was reported by the github user `welderpb` with P/R:
 #14431

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 036079b)
Lienol pushed a commit to Lienol/openwrt-packages that referenced this pull request Jun 24, 2021
If pppoe is used for wan access. script set 'eth1' as interface for curl
call. The correct interface is however 'pppoe-wan'.

The script uses 'network_get_physdev' function to get real device for
bind_network but this is wrong. We need instead the l3_device of the the
logical interface.

In case if we don't use pppoe connection - 'l3_device' is equal to real device.

This was reported by the github user `welderpb` with P/R:
 openwrt/packages#14431

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Lienol pushed a commit to Lienol/openwrt-packages that referenced this pull request Nov 19, 2021
If pppoe is used for wan access. script set 'eth1' as interface for curl
call. The correct interface is however 'pppoe-wan'.

The script uses 'network_get_physdev' function to get real device for
bind_network but this is wrong. We need instead the l3_device of the the
logical interface.

In case if we don't use pppoe connection - 'l3_device' is equal to real device.

This was reported by the github user `welderpb` with P/R:
 openwrt/packages#14431

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Lienol pushed a commit to Lienol/openwrt-packages that referenced this pull request Dec 19, 2021
If pppoe is used for wan access. script set 'eth1' as interface for curl
call. The correct interface is however 'pppoe-wan'.

The script uses 'network_get_physdev' function to get real device for
bind_network but this is wrong. We need instead the l3_device of the the
logical interface.

In case if we don't use pppoe connection - 'l3_device' is equal to real device.

This was reported by the github user `welderpb` with P/R:
 openwrt/packages#14431

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Lienol pushed a commit to Lienol/openwrt-packages that referenced this pull request Dec 19, 2021
If pppoe is used for wan access. script set 'eth1' as interface for curl
call. The correct interface is however 'pppoe-wan'.

The script uses 'network_get_physdev' function to get real device for
bind_network but this is wrong. We need instead the l3_device of the the
logical interface.

In case if we don't use pppoe connection - 'l3_device' is equal to real device.

This was reported by the github user `welderpb` with P/R:
 openwrt/packages#14431

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Lienol pushed a commit to Lienol/openwrt-packages that referenced this pull request Feb 11, 2022
If pppoe is used for wan access. script set 'eth1' as interface for curl
call. The correct interface is however 'pppoe-wan'.

The script uses 'network_get_physdev' function to get real device for
bind_network but this is wrong. We need instead the l3_device of the the
logical interface.

In case if we don't use pppoe connection - 'l3_device' is equal to real device.

This was reported by the github user `welderpb` with P/R:
 openwrt/packages#14431

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Lienol pushed a commit to Lienol/openwrt-packages that referenced this pull request Jan 4, 2023
If pppoe is used for wan access. script set 'eth1' as interface for curl
call. The correct interface is however 'pppoe-wan'.

The script uses 'network_get_physdev' function to get real device for
bind_network but this is wrong. We need instead the l3_device of the the
logical interface.

In case if we don't use pppoe connection - 'l3_device' is equal to real device.

This was reported by the github user `welderpb` with P/R:
 openwrt/packages#14431

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Lienol pushed a commit to Lienol/openwrt-packages that referenced this pull request Mar 2, 2024
If pppoe is used for wan access. script set 'eth1' as interface for curl
call. The correct interface is however 'pppoe-wan'.

The script uses 'network_get_physdev' function to get real device for
bind_network but this is wrong. We need instead the l3_device of the the
logical interface.

In case if we don't use pppoe connection - 'l3_device' is equal to real device.

This was reported by the github user `welderpb` with P/R:
 openwrt/packages#14431

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
rbqvq added a commit to rbqvq/packages that referenced this pull request Jan 15, 2025
If pppoe is used for wan access. script set 'eth1' as interface for curl
call. The correct interface is however 'pppoe-wan'.

These scripts use 'network_get_physdev' function to get real device for
bind_network but this is wrong. We need instead the l3_device of the the
logical interface.

In case if we don't use pppoe connection - 'l3_device' is equal to real device.

Follow P/R:
 openwrt#14431

Signed-off-by: Coia Prant <coiaprant@gmail.com>
rbqvq added a commit to rbqvq/packages that referenced this pull request Jan 15, 2025
If pppoe is used for wan access. script set 'eth1' as interface for curl
call. The correct interface is however 'pppoe-wan'.

These scripts use 'network_get_physdev' function to get real device for
bind_network but this is wrong. We need instead the l3_device of the the
logical interface.

In case if we don't use pppoe connection - 'l3_device' is equal to real device.

Follow P/R:
 openwrt#14431

Signed-off-by: Coia Prant <coiaprant@gmail.com>

Signed-off-by: Coia Prant <coiaprant@gmail.com>
rbqvq added a commit to rbqvq/packages that referenced this pull request Jan 19, 2025
If pppoe is used for wan access. script set 'eth1' as interface for curl
call. The correct interface is however 'pppoe-wan'.

These scripts use 'network_get_physdev' function to get real device for
bind_network but this is wrong. We need instead the l3_device of the the
logical interface.

In case if we don't use pppoe connection - 'l3_device' is equal to real device.

Follow P/R:
 openwrt#14431

Signed-off-by: Coia Prant <coiaprant@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants