WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Missing packages: iptables, dnsmasq, mosquitto  (Read 3136 times)

Offline rakin

  • Newbie
  • *
  • Posts: 4
Missing packages: iptables, dnsmasq, mosquitto
« on: July 12, 2020, 09:35:19 AM »
Hi there,
Any chances for packages from subject in 11.x?
Or maybe some good tutorial how to build them on x86_64 (I mean  about the cross compilation)?

Best,
R

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Missing packages: iptables, dnsmasq, mosquitto
« Reply #1 on: July 12, 2020, 10:21:55 AM »
It's probably easier to compile them natively on an RPi3 or RPi4.

See, for example http://tinycorelinux.net/8.x/armv7/tcz/src/dnsmasq/

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Missing packages: iptables, dnsmasq, mosquitto
« Reply #2 on: July 12, 2020, 10:34:12 AM »
Hi rakin
Welcome to the forum. If you wish to try compiling natively on Pi, there are build scripts in the  iptables  and  dnsmasq  directories
found here:
http://tinycorelinux.net/8.x/armv6/tcz/src/
The scripts also handle packaging the programs into  .tcz  files.

I'm not aware of any cross compilation tools.

You could also try copying them over from the TC9 repository.

The dependency file for  dnsmasq.tcz  shows:
Code: [Select]
ipv6-KERNEL.tcz
which is listed in the TC11 repository:
http://tinycorelinux.net/11.x/armv6/tcz/

The  iptables.tcz  is not as simple. The dependency tree looks like this:
Code: [Select]
iptables.tcz
   libnftnl.tcz
      jansson.tcz
      libmnl.tcz
         netfilter-4.9.10-piCore.tcz
         ipv6-4.9.10-piCore.tcz
While you might be able to copy over  libnftnl.tcz  and  libmnl.tcz , netfilter-4.9.10-piCore.tcz  is kernel version specific and can not
be copied over.

It needs to be packaged from  modules.tar.gz  found here:
http://tinycorelinux.net/11.x/armv6/releases/RPi/src/kernel/
In x86 that's handled by the  sorter.sh  script found here:
https://github.com/tinycorelinux/sorter/archive/master.zip
I don't know why ARM doesn't also use that script.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1063
Re: Missing packages: iptables, dnsmasq, mosquitto
« Reply #3 on: July 12, 2020, 07:13:42 PM »
It should copy pretty easily, I can update the packages sometime this week if needed.

Offline rakin

  • Newbie
  • *
  • Posts: 4
Re: Missing packages: iptables, dnsmasq, mosquitto
« Reply #4 on: July 13, 2020, 05:00:10 AM »
Hi,

It seems that building these packages requires some non-trivial work, which I would rather not dive in. At least not now (I do not even have RPI3/4 at hand; RPI-Zero-W is my target). Maybe I will get back to piCore and try to build missing packages, but for now I'm gonna look for a ready to use solution. Alpine is my next choice after Rasbian (which has its own problems) and piCore.
 
Thanks for the input and links. I will keep them in case I can not find out something that can be used out of the box. Paul, if you can help with any of these packages I would appreciate.

BTW, I really like the idea behind Tiny Core. It looks really solid. It took me (a total newbie) under two hours to set up my Raspberry Pi Zero W to work simultaneously in station and AP modes. Unfortunately, without iptables I can not test, if it can reliably work as a WiFi extender. And without dnsmasq (or other dhcp server) and some MQTT broker I can not easily set it up as an IOT hub.

Anyway, thank you for all your hard work.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1063
Re: Missing packages: iptables, dnsmasq, mosquitto
« Reply #5 on: July 19, 2020, 04:58:25 AM »
Iptables and dnsmasq have been updated and posted.  I did not have a chance to test them much.  Mosquitto is a bit to special case, and I have no idea what options you need.....but it builds easily.


Offline rakin

  • Newbie
  • *
  • Posts: 4
Re: Missing packages: iptables, dnsmasq, mosquitto
« Reply #6 on: July 27, 2020, 12:05:58 AM »
Thanks Paul

I'll have some time next week to test that packages. Also I already have RPi 3, so I will try to build mosquito package and maybe even contribute it to the community.

R.

Offline wesley1

  • Newbie
  • *
  • Posts: 5
Re: Missing packages: iptables, dnsmasq, mosquitto
« Reply #7 on: July 27, 2020, 11:51:28 AM »
Can bridge-utils be made available too?

Only see an old one
http://tinycorelinux.net/3.x/tcz/src/bridge-utils/

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Missing packages: iptables, dnsmasq, mosquitto
« Reply #8 on: July 27, 2020, 11:47:30 PM »
bridge-utils posted (not tested)

Offline wesley1

  • Newbie
  • *
  • Posts: 5
Re: Missing packages: iptables, dnsmasq, mosquitto
« Reply #9 on: July 28, 2020, 09:57:59 PM »
works well, can libpcap be added too? thank you.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Missing packages: iptables, dnsmasq, mosquitto
« Reply #10 on: July 28, 2020, 11:23:40 PM »
libpcap posted
« Last Edit: July 29, 2020, 12:33:31 AM by Juanito »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Missing packages: iptables, dnsmasq, mosquitto
« Reply #11 on: July 28, 2020, 11:54:56 PM »
mosquitto posted (not tested)

Offline rakin

  • Newbie
  • *
  • Posts: 4
Re: Missing packages: iptables, dnsmasq, mosquitto
« Reply #12 on: August 10, 2020, 08:29:27 AM »
I tested the iptables package. Seems to work properly, but the iptables.tcz.tree file is outdated (it points to netfilter-4.9.22-piCore.tcz and ipv6-4.9.22-piCore.tcz packages which are not available in those versions).

I have not tested dnsmasq and mosquitto packages yet, as I encountered a strange problem I need to solve before further tests. Let me describe the problem briefly (in case anyone here already seen it).

Here my the setup:
1. Raspberry PI Zero W
2. Second wireless interface is added using following commands:
Code: [Select]
iw phy phy0 interface add ap0 type __ap; ifconfig ap0 hw ether b8:27:eb:81:84:dd3. dhcpcd and wpa_suppicant are used to connect to home network (this works without a problem)
4. hostapd and udhcpd are used to create an access point and configure clients.
5. iptables is used to configure SNAT
Code: [Select]
iptables -t nat -A POSTROUTING -o wlan0 -j SNAT --to-source `ifconfig wlan0 |grep "inet addr:" |sed -e "s/.*inet addr:\([^ ]*\).*/\1/"` .
6. IP forwarding is also enabled
Code: [Select]
/sbin/sysctl -w net.ipv4.ip_forward=1.

(Below you can find config files and network configuration).


I can connect to the AP and obtain an IP address. Unfortunately, I can not ping the AP from connected clients (I also can not ssh to the AP), even though I can ping other wireless clients connected to the AP. Also, I have no access to the internet (nor the home network). The strange thing is that all these problems disappear after I ping connected clients from the RPi (AP). Then suddenly the client that was pinged can connect to the AP and to the internet.

Any advice? Maybe someone has already seen this before?

Here is hostapd.conf:

Code: [Select]
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
interface=ap0
driver=nl80211
ssid=APname
hw_mode=g
channel=10
wmm_enabled=0
macaddr_acl=0
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
wpa_passphrase=passphrase

And the network configuration:

Code: [Select]
$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.254   0.0.0.0         UG    302    0        0 wlan0
127.0.0.1       0.0.0.0         255.255.255.255 UH    0      0        0 lo
192.168.1.0     0.0.0.0         255.255.255.0   U     302    0        0 wlan0
192.168.40.0    0.0.0.0         255.255.255.0   U     303    0        0 ap0

$ ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr B8:27:EB:81:84:DC 
          inet addr:192.168.1.13  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::c946:91c0:88a7:ab56/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:443 errors:0 dropped:0 overruns:0 frame:0
          TX packets:268 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:33470 (32.6 KiB)  TX bytes:40525 (39.5 KiB)

$ ifconfig ap0
ap0       Link encap:Ethernet  HWaddr B8:27:EB:81:84:DD 
          inet addr:192.168.40.1  Bcast:192.168.40.255  Mask:255.255.255.0
          inet6 addr: fe80::ba27:ebff:fe81:84dd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:1386 (1.3 KiB)



Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1063
Re: Missing packages: iptables, dnsmasq, mosquitto
« Reply #13 on: August 10, 2020, 11:01:34 AM »
Hostapd weirdness is a known issue with RPi boards, with certain versions of firmware.   I can't keep track of it.   Typically if I'm running hostapd (Which I don't often do), I do not use RPI wifi.

I would try to remove the extra layer you have in between wlan0 and ap0......see what happens.

Here is the config I used.

Code: [Select]
interface=wlan0
driver=nl80211
ssid=piCore
wpa_key_mgmt=WPA-PSK
wpa=2
wpa_psk=---------------------------------------
country_code=US
hw_mode=g
channel=7
wmm_enabled=1
ieee80211n=1
ieee80211ac=0
#Capabilities of the rpi3 wifi chip
#Disabled by default, as to not break other possible wifi chips.
#ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
logger_stdout=-1
logger_stdout_level=2