Hello,
I have a Raspberry Pi which connects to the internet with an 4G USB dongle, I'm using wvdial and it's working fine. I want to attach another device to the Ethernet port and share the connection with it. I read some examples that suggest installing iptables and dnsmasq, but I can't seem to make it work.
Is anyone able to assist me with the correct setup?!
These are the parts I've modified in /etc/dnsmasq.conf
$this->bbcode_second_pass_code('', '
# Never forward plain names (without a dot or domain part)
domain-needed
# Never forward addresses in the non-routed address spaces.
bogus-priv
# If you want dnsmasq to listen for DHCP and DNS requests only on
# specified interfaces (and the loopback) give the name of the
# interface (eg eth0) here.
# Repeat the line for more than one interface.
interface=eth0
# Or you can specify which interface _not_ to listen on
except-interface=wwan0
# This is an example of a DHCP range where the netmask is given. This
# is needed for networks we reach the dnsmasq DHCP server via a relay
# agent. If you don't know what a DHCP relay agent is, you probably
# don't need to worry about this.
dhcp-range=eth0,192.168.88.1,192.168.88.254,255.255.255.0,12h')
What I see in the log is:
$this->bbcode_second_pass_code('', 'Dec 12 20:52:02 systemd[1]: Starting A lightweight DHCP and caching DNS server...
Dec 12 20:52:02 dnsmasq[1073]: dnsmasq: syntax check OK.
Dec 12 20:52:02 systemd[1]: Started A lightweight DHCP and caching DNS server.
Dec 12 20:52:02 dnsmasq[1074]: started, version 2.78 cachesize 150
Dec 12 20:52:02 dnsmasq[1074]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
Dec 12 20:52:02 dnsmasq[1074]: DBus support enabled: connected to system bus
Dec 12 20:52:02 dnsmasq[1074]: warning: interface eth0 does not currently exist
Dec 12 20:52:02 dnsmasq-dhcp[1074]: DHCP, IP range 192.168.88.1 -- 192.168.88.254, lease time 12h
Dec 12 20:52:02 dnsmasq[1074]: reading /etc/resolv.conf
Dec 12 20:52:02 dnsmasq[1074]: using nameserver 85.118.197.4#53
Dec 12 20:52:02 dnsmasq[1074]: using nameserver 85.118.197.68#53
Dec 12 20:52:02 dnsmasq[1074]: read /etc/hosts - 3 addresses
Dec 12 20:52:08 dnsmasq-dhcp[1074]: DHCP packet received on eth0 which has no address
Dec 12 20:52:09 dnsmasq-dhcp[1074]: DHCP packet received on eth0 which has no address
Dec 12 20:52:12 dnsmasq-dhcp[1074]: DHCP packet received on eth0 which has no address
Dec 12 20:52:16 dnsmasq-dhcp[1074]: DHCP packet received on eth0 which has no address')
It appears that for some reason the second device cannot obtain an IP address from the R-Pi.