I've posted a bunch of configs at the bottom, if anything else is needed please let me know. The main things I've got installed and set up so far are: netctl, openresolv, vsftpd, samba file sharing, iptables(very basic atm due to the issues I'm having), apache/lamp, and dnsmasq for cache/dhcp services among other random apps/services.
I've got internet connection sharing on the odroid via dnsmasq/iptables, it's set up going from on-board ethernet to usb3 gigabit ethernet. Internet comes in through on-board ethernet device net0(eth0 is net0 via udev rule) and out through usb ethernet device net1(eth1 is net1 renamed via udev rule). The shared connection is quick and reliable, but I just cannot get internet connection sharing to work by connecting the shared connection to a router's wan port. Sharing to the router's lan port as a switch/AP barely works sometimes and it's not what I want anyway....
So, I've tried connecting this second router to the odroid's share internet as a switch/AP, turning on and off dhcp, manually and automatically assigning dns... but nothing works completely. I just cannot get it to work properly as a switch/AP and as I said it's not what I want anyway. For whatever reason only one device can connect to the router's wifi when it receives internet shared from the odroid to the router's lan instead of its wan port. Devices plugged into the other open lan ports of this second router get no internet access at all.... Connecting from the odroid's shared internet to second router's wan gives me nothing, no internet, and I usually can't even access this second router's web admin console....
ATM I have this second router plugged into a lan port on my ips's router/modem. I've added a route in the routing table of the isp's modem/router so I am able to plug from isp's modem/router lan port to wan of the second router. This works, both routers work....
Here is what I added in routing on my isp's modem/router to be able to plug from a lan port on my isp's modem/router to the wan port of the second router:
$this->bbcode_second_pass_code('', '
destination 172.16.0.1
netmask 255.255.255.255
gateway 192.168.1.1
metric 2
')
The two routers work perfect, aside from the fact the none of my odroid's services are accessible from the second router... My reason for wanting to have the odroid in the middle of the two routers is because I want at the very least samba and ftp to work on both subnets
What in the world do I have to do do get internet from my isp's router(192.168.1.1/24) through the odroid and to the second router(172.16.0.1/24). I have a feeling I need to add a route like I did on my isp's modem/router to get the second router to work. I'm assuming I need to add a route from net0(internet in) to net1(ethernet sharing the internet) but I'm not sure how or at least not how to make it stick after a reboot... below I will post my configs
$this->bbcode_second_pass_code('', '/etc/udev/rules.d/10-network.rules')
$this->bbcode_second_pass_code('', '
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:1e:06:32:10:17", NAME="net0"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:13:3b:8b:28:84", NAME="net1"
')
$this->bbcode_second_pass_code('', '/etc/netctl/net0')
$this->bbcode_second_pass_code('', '
Description='A basic dhcp ethernet connection'
Interface=net0
Connection=ethernet
IP=dhcp
DHCPClient=dhcpcd
#DHCPReleaseOnStop=no
## for DHCPv6
#IP6=dhcp
#DHCP6Client=dhclient
## for IPv6 autoconfiguration
#IP6=stateless
')
$this->bbcode_second_pass_code('', '/etc/netctl/net1')
$this->bbcode_second_pass_code('', '
Description='A basic static ethernet connection'
Interface=net1
Connection=ethernet
IP=static
Address=('172.16.0.1/24')
#Routes=('172.16.0.0/24 via 192.168.1.1')
#Gateway='192.168.1.1'
#DNS=('192.168.1.1')
ExcludeAuto=no
SkipNoCarrier=yes
## For IPv6 autoconfiguration
#IP6=stateless
## For IPv6 static address configuration
#IP6=static
#Address6=('1234:5678:9abc:def::1/64' '1234:3456::123/96')
#Routes6=('abcd::1234')
#Gateway6='1234:0:123::abcd'
')
$this->bbcode_second_pass_code('', 'ip route show')
$this->bbcode_second_pass_code('', '
default via 192.168.1.1 dev net0 src 192.168.1.229 metric 202
172.16.0.0/24 dev net1 proto kernel scope link src 172.16.0.1
192.168.1.0/24 dev net0 proto kernel scope link src 192.168.1.229 metric 202
')
atm here are my iptables
$this->bbcode_second_pass_code('', '/etc/iptables/iptables.rules')
$this->bbcode_second_pass_code('', '
# Generated by iptables-save v1.6.0 on Sun Jun 19 23:51:55 2016
*filter
:INPUT ACCEPT [306:35418]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [199:17646]
-A FORWARD -i net1 -o net0 -j ACCEPT
-A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
COMMIT
# Completed on Sun Jun 19 23:51:55 2016
# Generated by iptables-save v1.6.0 on Sun Jun 19 23:51:55 2016
*nat
:PREROUTING ACCEPT [96:6253]
:INPUT ACCEPT [57:4381]
:OUTPUT ACCEPT [19:2095]
:POSTROUTING ACCEPT [4:677]
-A POSTROUTING -o net0 -j MASQUERADE
COMMIT
# Completed on Sun Jun 19 23:51:55 2016
# Generated by iptables-save v1.6.0 on Sun Jun 19 23:51:55 2016
*mangle
:PREROUTING ACCEPT [910:120931]
:INPUT ACCEPT [816:116427]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [570:51783]
:POSTROUTING ACCEPT [583:54290]
COMMIT
# Completed on Sun Jun 19 23:51:55 2016
# Generated by iptables-save v1.6.0 on Sun Jun 19 23:51:55 2016
*raw
:PREROUTING ACCEPT [1553:237859]
:OUTPUT ACCEPT [989:90577]
COMMIT
# Completed on Sun Jun 19 23:51:55 2016
')
$this->bbcode_second_pass_code('', '/etc/resolvconf.conf')
$this->bbcode_second_pass_code('', '
# Configuration for resolvconf(8)
# See resolvconf.conf(5) for details
resolv_conf=/etc/resolv.conf
# If you run a local name server, you should uncomment the below line and
# configure your subscribers configuration files below.
name_servers=127.0.0.1
# Write out dnsmasq extended configuration and resolv files
#dnsmasq_conf=/etc/dnsmasq-resolvconf.conf
dnsmasq_resolv=/etc/dnsmasq-resolv.conf
')
$this->bbcode_second_pass_code('', '/etc/resolv.conf')
$this->bbcode_second_pass_code('', '
# Generated by resolvconf
domain fios-router.home
nameserver 127.0.0.1
')
$this->bbcode_second_pass_code('', '/etc/dhcpcd.conf')
$this->bbcode_second_pass_code('', '
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.
# Allow users of this group to interact with dhcpcd via the control socket.
controlgroup wheel
# Inform the DHCP server of our hostname for DDNS.
hostname
# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
#duid
# Persist interface configuration when dhcpcd exits.
persistent
# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit
# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate Stable Private IPv6 Addresses instead of hardware based ones
#slaac private
noipv4ll
#nohook resolv.conf
noarp
static domain_name_servers=68.237.161.12,71.250.0.12,192.168.1.1
noipv6rs
noipv6
')
$this->bbcode_second_pass_code('', '/etc/dnsmasq.conf')
$this->bbcode_second_pass_code('', '
#/etc/dnsmasq.conf
resolv-file=/etc/dnsmasq-resolv.conf
#conf-file=/etc/dnsmasq-resolvconf.conf
domain-needed
port=53
local=/xxxxxxxxxx.no-ip.org/
bogus-priv
domain=xxxxxxxxxx.no-ip.org
expand-hosts
server=68.237.161.12#(verizon fios dns servers)
server=71.250.0.12#(verizon fios dns servers)
listen-address=192.168.1.229#odroid reserver dhcp address in isp router
listen-address=127.0.0.1
listen-address=172.16.0.1#static assigned by netctl
interface=net1
interface=lo
no-dhcp-interface=net0
bind-interfaces
dhcp-range=172.16.0.2,172.16.0.100,12h
dhcp-authoritative
dhcp-leasefile=/var/lib/misc/dnsmasq.leases
cache-size=10000
log-queries
log-dhcp
')
I don't know what I'm supposed to have in /etc/dnsmasq-resolvconf.conf so that's why it's commented out. I'm posting post what it ends up as after
$this->bbcode_second_pass_code('', ' sudo resolvconf -u')
$this->bbcode_second_pass_code('', '/etc/dnsmasq-resolvconf.conf')
$this->bbcode_second_pass_code('', '
# Generated by resolvconf
# Domain specific servers will be sent over dbus
')
So as you see, there is nothing really there....
$this->bbcode_second_pass_code('', '/etc/dnsmasq-resolv.conf')
$this->bbcode_second_pass_code('', '
# Generated by resolvconf
nameserver 68.237.161.12,71.250.0.12,192.168.1.1
')
Here's what I get when I check dnsmasq's status:
$this->bbcode_second_pass_code('', '
[alarm@alarm etc]$ sudo systemctl status -l dnsmasq.service
* dnsmasq.service - A lightweight DHCP and caching DNS server
Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2016-06-25 23:26:01 EDT; 1s ago
Docs: man:dnsmasq(8)
Process: 2517 ExecStartPre=/usr/bin/dnsmasq --test (code=exited, status=0/SUCCESS)
Main PID: 2521 (dnsmasq)
CGroup: /system.slice/dnsmasq.service
`-2521 /usr/bin/dnsmasq -k --enable-dbus --user=dnsmasq --pid-file
Jun 25 23:26:01 alarm dnsmasq[2521]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-L
Jun 25 23:26:01 alarm systemd[1]: Started A lightweight DHCP and caching DNS server.
Jun 25 23:26:01 alarm dnsmasq[2521]: DBus support enabled: connected to system bus
Jun 25 23:26:01 alarm dnsmasq-dhcp[2521]: DHCP, IP range 172.16.0.2 -- 172.16.0.100, lease time 12h
Jun 25 23:26:01 alarm dnsmasq-dhcp[2521]: DHCP, sockets bound exclusively to interface net1
Jun 25 23:26:01 alarm dnsmasq[2521]: using nameserver 71.250.0.12#53
Jun 25 23:26:01 alarm dnsmasq[2521]: using nameserver 68.237.161.12#53
Jun 25 23:26:01 alarm dnsmasq[2521]: using local addresses only for domain xxxxxxxxxx.no-ip.org
Jun 25 23:26:01 alarm dnsmasq[2521]: no servers found in /etc/dnsmasq-resolv.conf, will retry
Jun 25 23:26:01 alarm dnsmasq[2521]: read /etc/hosts - 2 addresses
')
notice the
$this->bbcode_second_pass_code('', 'Jun 25 23:26:01 alarm dnsmasq[2521]: no servers found in /etc/dnsmasq-resolv.conf, will retry')
I know for a fact there are servers listed there, just not as I would expect the format to be and maybe that's why it says none are there
When I manually edit this file:
$this->bbcode_second_pass_code('', '/etc/dnsmasq-resolv.conf')
so it looks like as it is below, instead of what resolvconf.conf makes:
$this->bbcode_second_pass_code('', '
# Generated by resolvconf
nameserver 68.237.161.12
nameserver 71.250.0.12
')
And I check dnsmasq's status...
$this->bbcode_second_pass_code('', '
[alarm@alarm etc]$ sudo systemctl status -l dnsmasq.service
[sudo] password for alarm:
* dnsmasq.service - A lightweight DHCP and caching DNS server
Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2016-06-25 20:31:39 EDT; 2h 54min ago
Docs: man:dnsmasq(8)
Process: 471 ExecStartPre=/usr/bin/dnsmasq --test (code=exited, status=0/SUCCESS)
Main PID: 480 (dnsmasq)
CGroup: /system.slice/dnsmasq.service
`-480 /usr/bin/dnsmasq -k --enable-dbus --user=dnsmasq --pid-file
Jun 25 22:03:47 alarm dnsmasq[480]: query[AAAA] alarm from 127.0.0.1
Jun 25 22:03:47 alarm dnsmasq[480]: config alarm is NODATA-IPv6
Jun 25 22:03:47 alarm dnsmasq[480]: query[A] alarm.fios-router.home from 127.0.0.1
Jun 25 22:03:47 alarm dnsmasq[480]: cached alarm.fios-router.home is NXDOMAIN
Jun 25 22:03:47 alarm dnsmasq[480]: query[AAAA] alarm.fios-router.home from 127.0.0.1
Jun 25 22:03:47 alarm dnsmasq[480]: cached alarm.fios-router.home is NXDOMAIN
Jun 25 22:03:47 alarm dnsmasq[480]: query[A] alarm from 127.0.0.1
Jun 25 22:03:47 alarm dnsmasq[480]: config alarm is NODATA-IPv4
Jun 25 22:03:47 alarm dnsmasq[480]: query[AAAA] alarm from 127.0.0.1
Jun 25 22:03:47 alarm dnsmasq[480]: config alarm is NODATA-IPv6
')
IT WORKS!!!!
When I reboot I'm back to this:
$this->bbcode_second_pass_code('', '/etc/dnsmasq-resolv.conf')
$this->bbcode_second_pass_code('', '
# Generated by resolvconf
nameserver 68.237.161.12,71.250.0.12,192.168.1.1
')
and this....
$this->bbcode_second_pass_code('', '
[alarm@alarm etc]$ sudo systemctl status -l dnsmasq.service
* dnsmasq.service - A lightweight DHCP and caching DNS server
Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2016-06-25 23:26:01 EDT; 1s ago
Docs: man:dnsmasq(8)
Process: 2517 ExecStartPre=/usr/bin/dnsmasq --test (code=exited, status=0/SUCCESS)
Main PID: 2521 (dnsmasq)
CGroup: /system.slice/dnsmasq.service
`-2521 /usr/bin/dnsmasq -k --enable-dbus --user=dnsmasq --pid-file
Jun 25 23:26:01 alarm dnsmasq[2521]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-L
Jun 25 23:26:01 alarm systemd[1]: Started A lightweight DHCP and caching DNS server.
Jun 25 23:26:01 alarm dnsmasq[2521]: DBus support enabled: connected to system bus
Jun 25 23:26:01 alarm dnsmasq-dhcp[2521]: DHCP, IP range 172.16.0.2 -- 172.16.0.100, lease time 12h
Jun 25 23:26:01 alarm dnsmasq-dhcp[2521]: DHCP, sockets bound exclusively to interface net1
Jun 25 23:26:01 alarm dnsmasq[2521]: using nameserver 71.250.0.12#53
Jun 25 23:26:01 alarm dnsmasq[2521]: using nameserver 68.237.161.12#53
Jun 25 23:26:01 alarm dnsmasq[2521]: using local addresses only for domain xxxxxxxxxx.no-ip.org
Jun 25 23:26:01 alarm dnsmasq[2521]: no servers found in /etc/dnsmasq-resolv.conf, will retry
Jun 25 23:26:01 alarm dnsmasq[2521]: read /etc/hosts - 2 addresses
')
I should add that when I was trying to plug the second router into the shared internet of the odroid I had my ip change by one number. In that case the second router's ip was set to 172.16.0.2
when I edit my
$this->bbcode_second_pass_code('', '/etc/dnsmasq.conf')
and
$this->bbcode_second_pass_code('', '/etc/resolvconf.conf')
and uncomment the following line
$this->bbcode_second_pass_code('', '
dnsmasq_conf=/etc/dnsmasq-resolvconf.conf
')
it still looks exactly the same:
$this->bbcode_second_pass_code('', '
# Generated by resolvconf
# Domain specific servers will be sent over dbus
')
and I still get the $this->bbcode_second_pass_code('', 'alarm dnsmasq[3778]: no servers found in /etc/dnsmasq-resolv.conf, will retry')
even though that file shows three nameservers, all on one line with a "," between each... just like I posted above
$this->bbcode_second_pass_code('', 'sudo systemctl status -l dnsmasq.service')
$this->bbcode_second_pass_code('', '
* dnsmasq.service - A lightweight DHCP and caching DNS server
Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2016-06-26 00:47:41 EDT; 7s ago
Docs: man:dnsmasq(8)
Process: 3774 ExecStartPre=/usr/bin/dnsmasq --test (code=exited, status=0/SUCCESS)
Main PID: 3778 (dnsmasq)
CGroup: /system.slice/dnsmasq.service
`-3778 /usr/bin/dnsmasq -k --enable-dbus --user=dnsmasq --pid-file
Jun 26 00:47:41 alarm dnsmasq[3778]: started, version 2.76 cachesize 10000
Jun 26 00:47:41 alarm dnsmasq[3778]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-L
Jun 26 00:47:41 alarm dnsmasq[3778]: DBus support enabled: connected to system bus
Jun 26 00:47:41 alarm dnsmasq-dhcp[3778]: DHCP, IP range 172.16.0.2 -- 172.16.0.100, lease time 12h
Jun 26 00:47:41 alarm dnsmasq-dhcp[3778]: DHCP, sockets bound exclusively to interface net1
Jun 26 00:47:41 alarm dnsmasq[3778]: using nameserver 71.250.0.12#53
Jun 26 00:47:41 alarm dnsmasq[3778]: using nameserver 68.237.161.12#53
Jun 26 00:47:41 alarm dnsmasq[3778]: using local addresses only for domain xxxxxxxxxx.no-ip.org
Jun 26 00:47:41 alarm dnsmasq[3778]: no servers found in /etc/dnsmasq-resolv.conf, will retry
Jun 26 00:47:41 alarm dnsmasq[3778]: read /etc/hosts - 2 addresses
')
I most definitely can't have it so every time I reboot that I have to edit this:
$this->bbcode_second_pass_code('', '/etc/dnsmasq-resolv.conf')
$this->bbcode_second_pass_code('', '
# Generated by resolvconf
nameserver 68.237.161.12,71.250.0.12,192.168.1.1
')
so it looks like this:
$this->bbcode_second_pass_code('', '
# Generated by resolvconf
nameserver 68.237.161.12
nameserver 71.250.0.12
')
Most importantly I really gotta get my odroid's shared internet connected to my second router's wan port. The devices plugged to the router's ethernet and connected by its wifi need access to my NAS. The whole point in buying the odroid was to upgrade from my RPi b+ not getting this working to me means it wasn't worth buying the odroid, much less all this headache....