Jump to content


Photo

OpenPLi-py3


  • Please log in to reply
1139 replies to this topic

Re: OpenPLi-py3 #821 Beeker

  • PLi® Contributor
  • 1,604 posts

+203
Excellent

Posted 27 February 2023 - 08:56

 

But no  /etc/resolv.conf. No file, no symlink.

 

It is created by openresolv, when the network is started (or restarted).

 

It is not the task of Enigma to meddle in linux network services.

 

Yes it does exist. Looked over it.


Dreambox dm920, Uclan Ustym4Kpro, Gigablue UHD TRIO 4K and Dreambox dm8000. Wavefrontier T55 13.0|19.2|23.5|28.2 + Ziggo.


Re: OpenPLi-py3 #822 Mr.Yoshi!

  • Senior Member
  • 226 posts

+1
Neutral

Posted 27 February 2023 - 08:56

hey ! maybe you can regulate that in the nfsroot! mac can actually be changed with it, but mac can also be used with a script and in the interface! maybe it works with nfsroot the dns! just a suggestion is actually the mac address then to change in the nfsroot!

# In case the interface is used as nfsroot, avoid ifup, otherwise # nfsroot may lose response if [ "$IFACE" = "eth0" ]; then /sbin/ifconfig eth0 hw ether 00:00:00:00:00:00 fi exit 0

P.s. DNS 1.1.1.1 is better than 8.8.8.8 Google :)

Mfg kittybua

Re: OpenPLi-py3 #823 Beeker

  • PLi® Contributor
  • 1,604 posts

+203
Excellent

Posted 27 February 2023 - 09:00

Problem is elf.ifaces["eth0"]["dns-nameserver"] doesn't update with defined nameservers.

 

self.nameservers is only written to /etc/resolv.conf.,

 

I use this patch for now.

diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py
index 04e20e745..2c5d56b1b 100644
--- a/lib/python/Components/Network.py
+++ b/lib/python/Components/Network.py
@@ -90,6 +90,7 @@ class Network:
 
 	def writeNetworkConfig(self):
 		self.configuredInterfaces = []
+		self.ifaces["eth0"]["dns-nameserver"] = self.nameservers
 		fp = open('/etc/network/interfaces', 'w')
 		fp.write("# automatically generated by enigma2\n# do NOT change manually!\n\n")
 		fp.write("auto lo\n")
@@ -109,15 +112,15 @@ class Network:
 					fp.write("	netmask %d.%d.%d.%d\n" % tuple(iface['netmask']))
 					if 'gateway' in iface:
 						fp.write("	gateway %d.%d.%d.%d\n" % tuple(iface['gateway']))
+					if iface["dns-nameserver"]:
+						for nameserver in iface["dns-nameserver"]:
+							fp.write("	dns-nameservers %d.%d.%d.%d\n" % tuple(nameserver))
 			if "configStrings" in iface:
 				fp.write(iface["configStrings"])
 			if iface["preup"] and "configStrings" not in iface:
 				fp.write(iface["preup"])
 			if iface["predown"] and "configStrings" not in iface:
 				fp.write(iface["predown"])
-			if iface["dns-nameserver"]:
-				for nameserver in iface["dns-nameserver"]:
-					fp.write("	dns-nameserver %d.%d.%d.%d\n" % tuple(nameserver))
 			fp.write("\n")
 		fp.close()
 		self.configuredNetworkAdapters = self.configuredInterfaces
@@ -177,7 +180,7 @@ class Network:
 				if split[0] in ("pre-down", "post-down"):
 					if "predown" in self.ifaces[currif]:
 						self.ifaces[currif]["predown"] = i
-				if split[0] == "dns-nameserver":
+				if split[0] == "dns-nameservers":
 					if "dns-nameserver" not in self.ifaces[currif]:
 						self.ifaces[currif]["dns-nameserver"] = []
 					dns_ip = self.convertIP(split[1])

 


Dreambox dm920, Uclan Ustym4Kpro, Gigablue UHD TRIO 4K and Dreambox dm8000. Wavefrontier T55 13.0|19.2|23.5|28.2 + Ziggo.


Re: OpenPLi-py3 #824 Beeker

  • PLi® Contributor
  • 1,604 posts

+203
Excellent

Posted 27 February 2023 - 09:23

 

One problem found in network.py
dns-nameserver must be dns-nameservers.


In fact, for several nameservers, the correct format is:

dns-nameservers 8.8.8.8 4.4.4.4

Not multiple lines with dns-nameservers, as suggested in the code.

 

 

Like this.

+					if iface["dns-nameserver"]:
+						fp.write("	dns-nameservers")
+						for nameserver in iface["dns-nameserver"]:
+							fp.write(" %d.%d.%d.%d" % tuple(nameserver))
+						fp.write("\n")

Need to update the reading code as well.


Edited by Beeker, 27 February 2023 - 09:24.

Dreambox dm920, Uclan Ustym4Kpro, Gigablue UHD TRIO 4K and Dreambox dm8000. Wavefrontier T55 13.0|19.2|23.5|28.2 + Ziggo.


Re: OpenPLi-py3 #825 marto

  • Senior Member
  • 121 posts

+7
Neutral

Posted 27 February 2023 - 09:35

Even with openresolv installed, after restart the file resolv.conf in /var/run is empty.

If i manually put the line "dns-nameservers 192.168.1.1" in interfaces, then after restart all is OK. The file resolv.conf contain:

# Generated by resolvconf
nameserver 192.168.1.1
 

VU+ Ultimo 4K; Clarke-Tech et9000


Re: OpenPLi-py3 #826 Beeker

  • PLi® Contributor
  • 1,604 posts

+203
Excellent

Posted 27 February 2023 - 09:47

Patch updated to write/read DNS at one line

diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py
index 04e20e745..d65c59e24 100644
--- a/lib/python/Components/Network.py
+++ b/lib/python/Components/Network.py
@@ -90,6 +90,7 @@ class Network:
 
 	def writeNetworkConfig(self):
 		self.configuredInterfaces = []
+		self.ifaces["eth0"]["dns-nameserver"] = self.nameservers
 		fp = open('/etc/network/interfaces', 'w')
 		fp.write("# automatically generated by enigma2\n# do NOT change manually!\n\n")
 		fp.write("auto lo\n")
@@ -109,15 +110,17 @@ class Network:
 					fp.write("	netmask %d.%d.%d.%d\n" % tuple(iface['netmask']))
 					if 'gateway' in iface:
 						fp.write("	gateway %d.%d.%d.%d\n" % tuple(iface['gateway']))
+					if iface["dns-nameserver"]:
+						fp.write("	dns-nameservers")
+						for nameserver in iface["dns-nameserver"]:
+							fp.write(" %d.%d.%d.%d" % tuple(nameserver))
+						fp.write("\n")
 			if "configStrings" in iface:
 				fp.write(iface["configStrings"])
 			if iface["preup"] and "configStrings" not in iface:
 				fp.write(iface["preup"])
 			if iface["predown"] and "configStrings" not in iface:
 				fp.write(iface["predown"])
-			if iface["dns-nameserver"]:
-				for nameserver in iface["dns-nameserver"]:
-					fp.write("	dns-nameserver %d.%d.%d.%d\n" % tuple(nameserver))
 			fp.write("\n")
 		fp.close()
 		self.configuredNetworkAdapters = self.configuredInterfaces
@@ -177,13 +180,14 @@ class Network:
 				if split[0] in ("pre-down", "post-down"):
 					if "predown" in self.ifaces[currif]:
 						self.ifaces[currif]["predown"] = i
-				if split[0] == "dns-nameserver":
+				if split[0] == "dns-nameservers":
 					if "dns-nameserver" not in self.ifaces[currif]:
 						self.ifaces[currif]["dns-nameserver"] = []
-					dns_ip = self.convertIP(split[1])
-					self.ifaces[currif]["dns-nameserver"].append(dns_ip)
-					if dns_ip not in self.nameservers:
-						self.nameservers.append(dns_ip)
+					for dnsip in split[1:]:
+						dns_ip = self.convertIP(dnsip)
+						self.ifaces[currif]["dns-nameserver"].append(dns_ip)
+						if dns_ip not in self.nameservers:
+							self.nameservers.append(dns_ip)
 
 		for ifacename, iface in ifaces.items():
 			if ifacename in self.ifaces:

 


Dreambox dm920, Uclan Ustym4Kpro, Gigablue UHD TRIO 4K and Dreambox dm8000. Wavefrontier T55 13.0|19.2|23.5|28.2 + Ziggo.


Re: OpenPLi-py3 #827 Dimitrij

  • PLi® Core member
  • 10,328 posts

+350
Excellent

Posted 27 February 2023 - 10:11

If wait until the end of the week, I will write the required code.

I started doing it.


Edited by Dimitrij, 27 February 2023 - 10:13.

GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: OpenPLi-py3 #828 neo

  • PLi® Contributor
  • 715 posts

+48
Good

Posted 27 February 2023 - 13:37

Even with openresolv installed, after restart the file resolv.conf in /var/run is empty.

If i manually put the line "dns-nameservers 192.168.1.1" in interfaces, then after restart all is OK. The file resolv.conf contain:

# Generated by resolvconf
nameserver 192.168.1.1

 

That indeed is the current workaround if you require a fixed DNS.
 



Re: OpenPLi-py3 #829 foxbob

  • Senior Member
  • 624 posts

+18
Neutral

Posted 27 February 2023 - 15:34

For example I set dns-dhcp enable:

nameserver 208.67.222.123
nameserver 208.67.220.123
 
And after the restart of the gui and a complete reboot the dns does not disappear.
And if I set dns 1.1.1.1 or 8.8.8.8 after restart, gui dns is not saved.


Re: OpenPLi-py3 #830 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 27 February 2023 - 15:52

And if I set dns 1.1.1.1 or 8.8.8.8 after restart, gui dns is not saved.

 
Where do you set dns?
It has already been stated here that without code corrections, fixed dns setting via GUI does not work.
You need to manually edit the file  /etc/network/interfaces and after restart the receiver.


Re: OpenPLi-py3 #831 foxbob

  • Senior Member
  • 624 posts

+18
Neutral

Posted 27 February 2023 - 16:10

It is already clear that the dns change does not work through the gui.It's just not clear why some dns settings through gui work, while others don't.

 

And even earlier if I chose a wlan then when setting it up, it was suggested to turn off the lan, but now this is not the case.Or is it just me.



Re: OpenPLi-py3 #832 foxbob

  • Senior Member
  • 624 posts

+18
Neutral

Posted 27 February 2023 - 16:13

It is already clear that the dns change does not work through the gui.

It's just not clear why some dns settings through gui work, while others don't.

And now, maybe only for me, when choosing a wlan and setting it up, it does not offer to disable another interface.

Attached Files



Re: OpenPLi-py3 #833 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 27 February 2023 - 16:23

In the case of dns from dhcp, you don't need to save or read anything and that's why it works.

 

openresolv is a resolvconf implementation. It will take the DNS information retrieved from dhcp and populate /etc/resolv.conf with it.

 

For DNS information entered manually, that issue was brought up by WanWizard and is hopefully on the way of being solved now.

 

( static DNS has to be confgured in /etc/network/interfaces, openresolv will use those too when populating resolv.conf )



Re: OpenPLi-py3 #834 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 27 February 2023 - 17:10

On the current openpli-develop on receiver Gigablue UHD UE 4K with fixed IP and DNS I observed very slow internet.
For example, opkg update takes at least 1 minute to download package information.
If I switch to openpli-8.3 in multiboot, there are no problems with internet speed.

Edited by Taapat, 27 February 2023 - 17:10.


Re: OpenPLi-py3 #835 neo

  • PLi® Contributor
  • 715 posts

+48
Good

Posted 27 February 2023 - 17:54

I can't reproduce that, the response here is direct.

root@hd66se:~# time sh -c "opkg update && opkg upgrade"
Downloading http://downloads.openpli.org/feeds/openpli-develop/3rd-party-cortexa15hf-neon-vfpv4/Packages.gz.
Updated source 'openpli-3rd-party-cortexa15hf-neon-vfpv4'.
Downloading http://downloads.openpli.org/feeds/openpli-develop/3rd-party/Packages.gz.
Updated source 'openpli-3rd-party'.
Downloading http://downloads.openpli.org/feeds/openpli-develop/3rd-party-hd66se/Packages.gz.
Updated source 'openpli-3rd-party-hd66se'.
Downloading http://downloads.openpli.org/feeds/openpli-develop/all/Packages.gz.
Updated source 'openpli-all'.
Downloading http://downloads.openpli.org/feeds/openpli-develop/cortexa15hf-neon-vfpv4/Packages.gz.
Updated source 'openpli-cortexa15hf-neon-vfpv4'.
Downloading http://downloads.openpli.org/feeds/openpli-develop/hd66se/Packages.gz.
Updated source 'openpli-hd66se'.
Downloading http://downloads.openpli.org/feeds/openpli-develop/picons/Packages.gz.
Updated source 'openpli-picons'.
No packages installed or removed.

real    0m3.334s
user    0m2.561s
sys     0m0.127s

Edited by neo, 27 February 2023 - 17:56.


Re: OpenPLi-py3 #836 neo

  • PLi® Contributor
  • 715 posts

+48
Good

Posted 27 February 2023 - 17:57

For example I set dns-dhcp enable:

nameserver 208.67.222.123
nameserver 208.67.220.123
 
And after the restart of the gui and a complete reboot the dns does not disappear.
And if I set dns 1.1.1.1 or 8.8.8.8 after restart, gui dns is not saved.

 

Then you've restored a /etc/resolv.conf, or deleted the symlink that is there after a flash and replaced it by a fixed file.



Re: OpenPLi-py3 #837 Taapat

  • PLi® Core member
  • 2,345 posts

+121
Excellent

Posted 27 February 2023 - 18:20

I can't reproduce that, the response here is direct.

I found that the problem is when I set as primary DNS my Mikrotik router which cached DNS records. Router dns cache flush doesn't help either.
If I set, for example, Cloudflare as primary, then there is no problem.
So far I have not observed anything like that.

Edited by Taapat, 27 February 2023 - 18:23.


Re: OpenPLi-py3 #838 neo

  • PLi® Contributor
  • 715 posts

+48
Good

Posted 27 February 2023 - 18:25

I run a PiHole as local DNS. I have a fixed IP and fixed DNS in my /etc/network/interfaces, pointing to it.



Re: OpenPLi-py3 #839 Mr.Yoshi!

  • Senior Member
  • 226 posts

+1
Neutral

Posted 1 March 2023 - 18:23

Hey can you this merge or commits with Dev pli ? Thanks

https://github.com/o...41e09ab61276a41

Edited by Mr.Yoshi!, 1 March 2023 - 18:23.


Re: OpenPLi-py3 #840 littlesat

  • PLi® Core member
  • 57,176 posts

+698
Excellent

Posted 1 March 2023 - 19:41

This is a merge on Openatv.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users