You are not logged in.

#1 2018-08-02 06:46:05

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Internet sharing, something's missing

Hello forum,

I've done successfully some time early last year, but this time I can't figure out what is wrong.

My set up has the server connected via tethering to an Android phone. Following the wiki I set static IP for the server and the client.
I've successfully connected through SSH the two machines.

Server details:

server~$ sudo ip link set dev enp4s0 up && sudo ip addr add 192.168.1.4/24 dev enp4s0 
server~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=119 time=85.10 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=119 time=68.2 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=119 time=32.7 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=119 time=31.2 ms

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 7ms
rtt min/avg/max/mdev = 31.218/54.530/85.966/23.423 ms

server~$ ip route
default via 192.168.43.1 dev wlp3s0 proto dhcp src 192.168.43.7 metric 303 
192.168.1.0/24 dev enp4s0 proto kernel scope link src 192.168.1.4 
192.168.43.0/24 dev wlp3s0 proto dhcp scope link src 192.168.43.7 metric 303

server~# juornalctl -u dnsmasq
Aug 02 13:32:11 AsusG75 systemd[1]: Starting A lightweight DHCP and caching DNS server...
Aug 02 13:32:11 AsusG75 dnsmasq[462]: dnsmasq: syntax check OK.
Aug 02 13:32:11 AsusG75 systemd[1]: Started A lightweight DHCP and caching DNS server.
Aug 02 13:32:11 AsusG75 dnsmasq[467]: started, version 2.79 cachesize 150
Aug 02 13:32:11 AsusG75 dnsmasq[467]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 n>
Aug 02 13:32:11 AsusG75 dnsmasq[467]: DBus support enabled: connected to system bus
Aug 02 13:32:11 AsusG75 dnsmasq[467]: warning: interface enp4s0 does not currently exist
Aug 02 13:32:11 AsusG75 dnsmasq-dhcp[467]: DHCP, IP range 192.168.1.2 -- 192.168.1.150, lease time 30m
Aug 02 13:32:11 AsusG75 dnsmasq[467]: reading /etc/resolv.dhcpcd.conf
Aug 02 13:32:11 AsusG75 dnsmasq[467]: using nameserver 67.215.92.210#53
Aug 02 13:32:11 AsusG75 dnsmasq[467]: using nameserver 8.8.8.8#53
Aug 02 13:32:11 AsusG75 dnsmasq[467]: using nameserver 4.4.4.4#53
Aug 02 13:32:11 AsusG75 dnsmasq[467]: read /etc/hosts - 4 addresses
Aug 02 13:48:45 AsusG75 dnsmasq-dhcp[467]: DHCPDISCOVER(enp4s0) 88:d7:f6:c2:f1:42
Aug 02 13:48:45 AsusG75 dnsmasq-dhcp[467]: DHCPOFFER(enp4s0) 192.168.1.32 88:d7:f6:c2:f1:42
Aug 02 13:48:45 AsusG75 dnsmasq-dhcp[467]: DHCPREQUEST(enp4s0) 192.168.1.32 88:d7:f6:c2:f1:42
Aug 02 13:48:45 AsusG75 dnsmasq-dhcp[467]: DHCPACK(enp4s0) 192.168.1.32 88:d7:f6:c2:f1:42 alarm
Aug 02 14:00:41 AsusG75 dnsmasq-dhcp[467]: DHCPRELEASE(enp4s0) 192.168.1.32 88:d7:f6:c2:f1:42
server~#cat /etc/resolv.conf
# Generated by resolvconf
nameserver 127.0.0.1

server~$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  192.168.1.0/24       anywhere             tcp dpt:domain
ACCEPT     udp  --  192.168.1.0/24       anywhere             udp dpt:domain
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootps
DROP       all  --  107.154.105.19.ip.incapdns.net  anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Client details:

client~# cat /etc/netctl/ethernet-static 
Description='A basic static ethernet connection'
Interface=eth0
Connection=ethernet
IP=static
Address=('192.168.1.2/24')
#Routes=('192.168.0.0/24 via 192.168.1.2')
Gateway='192.168.1.1'
DNS=('192.168.1.1')

## 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

client~# ping -c4 8.8.8.8                             
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3004ms

client~# ip route
default via 192.168.1.4 dev eth0 
default via 192.168.1.4 dev eth0 proto dhcp src 192.168.1.32 metric 203 
192.168.1.0/24 dev eth0 proto dhcp scope link src 192.168.1.32 metric 203

client~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1
    link/sit 0.0.0.0 brd 0.0.0.0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether 88:d7:f6:c2:f1:42 brd ff:ff:ff:ff:ff:ff

client~# cat /etc/resolv.conf            
# Generated by resolvconf
nameserver 192.168.1.1

I've tried to change the client route

# ip route change default via 192.168.1.4

Without any positive results.
I've tried dhcpcd eth0 from the client, same trouble sad
Maybe some package changes happened since last time I used the internet sharing, but I hardly guess what it might be.


do it good first, it will be faster than do it twice the saint wink

Offline

#2 2018-08-02 13:53:44

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Internet sharing, something's missing

Looks like you have set both server enp4s0 and client etho to  the same address, 192.168.1.4/24 .

post ip addr for both systems.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2018-08-02 17:57:33

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: Internet sharing, something's missing

client~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1
    link/sit 0.0.0.0 brd 0.0.0.0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether 88:d7:f6:c2:f1:42 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.2/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::8ad7:f6ff:fec2:f142/64 scope link 
       valid_lft forever preferred_lft forever

server~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:60:6e:18:78:3f brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.4/24 scope global enp4s0
       valid_lft forever preferred_lft forever
    inet6 fe80::a60:6eff:fe18:783f/64 scope link 
       valid_lft forever preferred_lft forever
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 6c:71:d9:1a:cd:20 brd ff:ff:ff:ff:ff:ff
    inet 192.168.43.7/24 brd 192.168.43.255 scope global noprefixroute wlp3s0
       valid_lft forever preferred_lft forever
    inet6 fe80::6e71:d9ff:fe1a:cd20/64 scope link 
       valid_lft forever preferred_lft forever

Am I correct ?


do it good first, it will be faster than do it twice the saint wink

Offline

#4 2018-08-02 23:27:54

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: Internet sharing, something's missing

Offline

#5 2018-08-03 16:42:05

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: Internet sharing, something's missing

Oh, yeah wink
I suspect that dnsmasq is not taking request from other clients. But this is what I have

server~$ sed -e 's/#.*$//' -e '/^$/d' dnsmasq.conf 
interface=enp4s0
listen-address=127.0.0.1
dhcp-range=192.168.1.2,192.168.1.150,30m
resolv-file=/etc/resolv.dhcpcd.conf

server~$ cat /etc/resolv.dhcpcd.conf
nameserver 67.215.92.210
nameserver 8.8.8.8
nameserver 4.4.4.4

do it good first, it will be faster than do it twice the saint wink

Offline

#6 2018-08-03 21:23:09

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Internet sharing, something's missing

Your dnsmasq setup conflicts with the values set by netctl.
The client static address setup is also incorrect.
The simplest setup for internet sharing is with 1 server, 1 client and static ip addresses.

disable and stop dnsmaq .

The enp4s0 card is the gateway for the clients, usually it gets the first address in the subnet .
You set it to 192.168.1.4 , better change it to 192.168.1.1 .
Keep the client netctl profile as is.


verify with ping <address> if server and clients can communicate both ways on the tcp/ip layer.
Once that has been confirmed, we can look into setting up DNS resolution.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2018-08-04 05:16:38

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: Internet sharing, something's missing

OK

server~$ ping tinkereth
PING tinkereth.localdomain (192.168.1.2) 56(84) bytes of data.
64 bytes from tinkereth.localdomain (192.168.1.2): icmp_seq=1 ttl=64 time=1.64 ms
64 bytes from tinkereth.localdomain (192.168.1.2): icmp_seq=2 ttl=64 time=0.763 ms
64 bytes from tinkereth.localdomain (192.168.1.2): icmp_seq=3 ttl=64 time=0.809 ms
64 bytes from tinkereth.localdomain (192.168.1.2): icmp_seq=4 ttl=64 time=0.794 ms

--- tinkereth.localdomain ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 36ms
rtt min/avg/max/mdev = 0.763/1.000/1.637/0.369 ms

server~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=119 time=268 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=119 time=267 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=119 time=235 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=119 time=204 ms

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 6ms
rtt min/avg/max/mdev = 204.381/243.710/268.043/26.240 ms

server~$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
DROP       all  --  107.154.105.19.ip.incapdns.net  anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

client~$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.663 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.792 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.766 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.771 ms

--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 7ms
rtt min/avg/max/mdev = 0.663/0.748/0.792/0.050 ms

client~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1
    link/sit 0.0.0.0 brd 0.0.0.0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 88:d7:f6:c2:f1:42 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.2/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::8ad7:f6ff:fec2:f142/64 scope link 
       valid_lft forever preferred_lft forever
4: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 40:9f:38:dd:97:3b brd ff:ff:ff:ff:ff:ff

client~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 10ms

Stopping dnsmasq led me to configure /etc/resolv.conf with what dnsmasq was using wink


do it good first, it will be faster than do it twice the saint wink

Offline

#8 2018-08-04 15:17:20

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Internet sharing, something's missing

That matches what i expected.

post ping 192.168.43.7 and traceroute 192.168.43.7 run on client,

also the output of route from server and client.



I expect the ping to fail.
The traceroute and route output should provide the necessary info for the next configuration step.

Last edited by Lone_Wolf (2018-08-04 15:20:02)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#9 2018-08-05 05:51:30

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: Internet sharing, something's missing

I think I missed to say that both machine can connect to WiFi via 192.168.43.1
So here it is:

client~$ ping 192.168.43.7
PING 192.168.43.7 (192.168.43.7) 56(84) bytes of data.
64 bytes from 192.168.43.7: icmp_seq=1 ttl=64 time=0.629 ms
64 bytes from 192.168.43.7: icmp_seq=2 ttl=64 time=0.808 ms
64 bytes from 192.168.43.7: icmp_seq=3 ttl=64 time=0.745 ms
64 bytes from 192.168.43.7: icmp_seq=4 ttl=64 time=0.724 ms

--- 192.168.43.7 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 5ms
rtt min/avg/max/mdev = 0.629/0.726/0.808/0.069 ms

client~$ ip route
default via 192.168.1.1 dev eth0 
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.2

client~$ traceroute 192.168.43.7
traceroute to 192.168.43.7 (192.168.43.7), 30 hops max, 60 byte packets
 1  192.168.43.7 (192.168.43.7)  1.008 ms  0.637 ms  0.733 ms

So, during the time I started the post and the actual status,I had a progress that I can connect the client directly to the Access Point, but the scope is not only to have the internet connection. For example I need to arrange an AP to the client which is not able to work in managed mode (AP with internet).

I appreciate for your kind help. If you guide me to start a brand new setup, I think it would be simpler. Just to consider that the server connects to the AP via 192.168.43.1 DHCP (receiving 192.168.43.7 IP), the client might be configure at wish, but ethernet link must be there, as long as I use SSH to work with the client.

Last edited by TheSaint (2018-08-05 05:52:55)


do it good first, it will be faster than do it twice the saint wink

Offline

#10 2018-08-05 14:03:37

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Internet sharing, something's missing

your desired network environment appears to involve these networks :
A wireless with dhcp , 192.168.43.0/24
B wired , 192.168.1.0/24
C internet

Network A is connected to network C through a router
your server uses wlp3s0 to connect to A and  enp4s0 to connect to network B
Your client is connected to B through eth0

Possible requirements that must be met :
1. server and client need to be able to connect to C .
2. server needs to be able to connect with the client.
3. client needs to be able to connect with stuff running on the server

An internet sharing setup has very limited routing capabilities and can only provide requirement 1.
For requirement 2 and 3 the server needs to be setup as a router.

Please verify whether this is  a correct description of your network environment and requirements.

Last edited by Lone_Wolf (2018-08-05 14:05:17)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#11 2018-08-06 07:50:14

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: Internet sharing, something's missing

My intent would be to connect server to internet wireless and client connected to server wired. Then the server should provide internet sharing for the only client.
So server goes through 192.168.43.0/24 and client should go through 192.168.1.0/24 and ask the server to share the internet. The 192.168.1.x IP is just an arbitrary choice, so we may change at wish, whether it will cause conflicts.
Server has dnsmasq set, to cache the addresses.
So the description is pretty right, just for the point 3, I'd say that the server would operate to the client via SSH, because the client is headless.


do it good first, it will be faster than do it twice the saint wink

Offline

#12 2018-08-06 21:49:05

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Internet sharing, something's missing

I thought our wiki had a decent article about setting up as arch linux as  a router, but all i can find are articles dealing with setting up an internet gateway that has some routing capabilities.
I'll have to translate my network knowledge to the commands from the ip suite.

setup wlp3s0 so it has a fixed ip-addres with full functionality to connect with internet and working name resolution.
For now we'll assume that address is 192.168.43.7 .

make sure enp4s0 is down without any ip address, then post ip addr show and ip route show .

next we want to setup enp4s0

ip link set dev enp4s0 up
ip address add 10.200.200.1/24 dev enp4s0
ip route add 10.200.200.0/24 dev enp4s0

After executing these commands post ip addr & ip route again.

Last edited by Lone_Wolf (2018-08-06 21:50:20)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#13 2018-08-07 04:55:14

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: Internet sharing, something's missing

server~$ ip link show enp4s0                                    ## verifying the state, while nothing connected
2: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether 08:60:6e:18:78:3f brd ff:ff:ff:ff:ff:ff

server~$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 08:60:6e:18:78:3f brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 6c:71:d9:1a:cd:20 brd ff:ff:ff:ff:ff:ff
    inet 192.168.43.7/24 brd 192.168.43.255 scope global noprefixroute wlp3s0
       valid_lft forever preferred_lft forever
    inet6 fe80::6e71:d9ff:fe1a:cd20/64 scope link 
       valid_lft forever preferred_lft forever

server~$ ip route show                                           ## just wlp3s0 connected wireless
default via 192.168.43.1 dev wlp3s0 proto dhcp src 192.168.43.7 metric 303 
192.168.43.0/24 dev wlp3s0 proto dhcp scope link src 192.168.43.7 metric 303

server~$ sudo ip link set dev enp4s0 up
server~$ sudo ip address add 10.200.200.1/24 dev enp4s0
server~$ sudo ip route add 10.200.200.0/24 dev enp4s0
RTNETLINK answers: File exists

server~$  ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 08:60:6e:18:78:3f brd ff:ff:ff:ff:ff:ff
    inet 10.200.200.1/24 scope global enp4s0
       valid_lft forever preferred_lft forever
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 6c:71:d9:1a:cd:20 brd ff:ff:ff:ff:ff:ff
    inet 192.168.43.7/24 brd 192.168.43.255 scope global noprefixroute wlp3s0
       valid_lft forever preferred_lft forever
    inet6 fe80::6e71:d9ff:fe1a:cd20/64 scope link 
       valid_lft forever preferred_lft forever
server~$ ip route show
default via 192.168.43.1 dev wlp3s0 proto dhcp src 192.168.43.7 metric 303 
10.200.200.0/24 dev enp4s0 proto kernel scope link src 10.200.200.1 linkdown 
192.168.43.0/24 dev wlp3s0 proto dhcp scope link src 192.168.43.7 metric 303 

All the command were issued without connecting the cable. Indeed once I've connected the lights still off. I presume because of the client is not started yet.
Also no iptables modified for these commands.


do it good first, it will be faster than do it twice the saint wink

Offline

#14 2018-08-07 15:25:28

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Internet sharing, something's missing

Yes, the network lights are only active when there's a working connection between the 2 network cards.

Maybe we'll need to enable masquerading in iptables later, but for now iptables shouldn't need any changes.

Try

ip route add 10.200.200.0/24 via 10.200.200.1 dev enp4s0

instead of "ip route add 10.200.200.0/24 dev enp4s0"
post ip route show and the output of ping 10.200.200.1

The next part is setting up the client .

ip link set dev eth0 up
ip address add 10.200.200.2/24 dev eth0
ip route add 10.200.200.0/24 via 10.200.200.1 dev eth0
ip route add default via 192.168.43.7

Assuming there are no error messages, we can continue with testing.

From client ping & traceroute for  10.200.200.2 , 10.200.200.1  and 192.168.43.7

From server ping & traceroute for 10.200.200.2

Last edited by Lone_Wolf (2018-08-07 15:26:39)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#15 2018-08-08 03:42:18

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: Internet sharing, something's missing

Starting conditions:
Server and client connected wireless to 192.168.43.1, dnsmasq running on the server.
Server and client connected by cable, but not set,

server~$ sudo ip route add 10.200.200.0/24 via 10.200.200.1 dev enp4s0
Error: Nexthop has invalid gateway.

server~$  ip route show
default via 192.168.43.1 dev wlp3s0 proto dhcp src 192.168.43.7 metric 303 
192.168.43.0/24 dev wlp3s0 proto dhcp scope link src 192.168.43.7 metric 303 

server~$ ping 10.200.200.1
PING 10.200.200.1 (10.200.200.1) 56(84) bytes of data.

--- 10.200.200.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 32ms

########### I added #################
server~$  sudo ip route add 10.200.200.0/24  dev enp4s0
##################################

server~$ ping 10.200.200.1
PING 10.200.200.1 (10.200.200.1) 56(84) bytes of data.
From 192.168.43.7 icmp_seq=1 Destination Host Unreachable
From 192.168.43.7 icmp_seq=2 Destination Host Unreachable
From 192.168.43.7 icmp_seq=3 Destination Host Unreachable
From 192.168.43.7 icmp_seq=4 Destination Host Unreachable

--- 10.200.200.1 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 40ms
pipe 4

server~$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.43.1    0.0.0.0         UG        0 0          0 wlp3s0
192.168.43.0    0.0.0.0         255.255.255.0   U         0 0          0 wlp3s0


client~$ sudo ip link set dev eth0 up

client~$ sudo ip address add 10.200.200.2/24 dev eth0

client~$ sudo ip route add 10.200.200.0/24 via 10.200.200.1 dev eth0
RTNETLINK answers: File exists

client~$ sudo ip route add default via 192.168.43.7

client~$ ping 10.200.200.2
PING 10.200.200.2 (10.200.200.2) 56(84) bytes of data.
64 bytes from 10.200.200.2: icmp_seq=1 ttl=64 time=0.277 ms
64 bytes from 10.200.200.2: icmp_seq=2 ttl=64 time=0.453 ms
64 bytes from 10.200.200.2: icmp_seq=3 ttl=64 time=0.203 ms
64 bytes from 10.200.200.2: icmp_seq=4 ttl=64 time=0.328 ms

--- 10.200.200.2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.203/0.315/0.453/0.091 ms

client~$ ping 10.200.200.1
PING 10.200.200.1 (10.200.200.1) 56(84) bytes of data.
From 10.200.200.2 icmp_seq=1 Destination Host Unreachable
From 10.200.200.2 icmp_seq=2 Destination Host Unreachable
From 10.200.200.2 icmp_seq=3 Destination Host Unreachable
From 10.200.200.2 icmp_seq=4 Destination Host Unreachable

--- 10.200.200.1 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 6ms
pipe 3

client~$ ping 192.168.43.7
PING 192.168.43.7 (192.168.43.7) 56(84) bytes of data.
64 bytes from 192.168.43.7: icmp_seq=1 ttl=64 time=7.07 ms
64 bytes from 192.168.43.7: icmp_seq=2 ttl=64 time=32.9 ms
64 bytes from 192.168.43.7: icmp_seq=3 ttl=64 time=3.32 ms
64 bytes from 192.168.43.7: icmp_seq=4 ttl=64 time=4.43 ms

--- 192.168.43.7 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 9ms
rtt min/avg/max/mdev = 3.323/11.934/32.919/12.192 ms

client~$ traceroute 10.200.200.2
traceroute to 10.200.200.2 (10.200.200.2), 30 hops max, 60 byte packets
 1  client (10.200.200.2)  0.507 ms  0.376 ms  0.347 ms

client~$ traceroute 10.200.200.1
traceroute to 10.200.200.1 (10.200.200.1), 30 hops max, 60 byte packets
 1  client (10.200.200.2)  2994.541 ms !H  2993.794 ms !H  2993.538 ms !H

client~$ traceroute 192.168.43.7
traceroute to 192.168.43.7 (192.168.43.7), 30 hops max, 60 byte packets
 1  _gateway (192.168.43.7)  9.148 ms  8.652 ms  8.304 ms

client~$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.43.7    0.0.0.0         UG        0 0          0 wlan0
0.0.0.0         192.168.43.1    0.0.0.0         UG        0 0          0 wlan0
10.200.200.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.43.0    0.0.0.0         255.255.255.0   U         0 0          0 wlan0


server~$ ping 10.200.200.2
PING 10.200.200.2 (10.200.200.2) 56(84) bytes of data.
From 192.168.43.7 icmp_seq=1 Destination Host Unreachable
From 192.168.43.7 icmp_seq=2 Destination Host Unreachable
From 192.168.43.7 icmp_seq=3 Destination Host Unreachable
From 192.168.43.7 icmp_seq=4 Destination Host Unreachable

--- 10.200.200.2 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 49ms
pipe 4

server~$ traceroute 10.200.200.2
traceroute to 10.200.200.2 (10.200.200.2), 30 hops max, 60 byte packets
 1  AsusG75 (192.168.43.7)  3044.163 ms !H  3044.151 ms !H  3044.145 ms !H

Due by the first error the server is not connected to the client. I'm sorry I'm not able to help, this is far from my knowledge.


do it good first, it will be faster than do it twice the saint wink

Offline

Board footer

Powered by FluxBB