Ubuntu Internet sharing not forwarding DHCP

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,340
4,018
75
I have a streaming player next to my TV that can use wifi or ethernet. The wifi hasn't been working well, and my Linux HTPC is right next to it, so I figured I'd try an ethernet cable between them. I set up the Linux PC like this. I can see packets on the network, but the streaming box reports no DHCP IP. I tried hooking up a laptop in place of the streaming box with the same result. DHCP should come over the wifi from a Linux server.

Any suggestions? Should I set up another DHCP server on the HTPC? If so, how?
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,340
4,018
75
I installed dnsmasq, which might help. It now claims to be serving DHCP:

dnsmasq-dhcp[1959]: DHCP, IP range 10.42.0.10 -- 10.42.0.254, lease time 1h

But the laptop doesn't see it.
 

mv2devnull

Golden Member
Apr 13, 2010
1,511
149
106
I can see packets on the network, but the streaming box reports no DHCP IP. DHCP should come over the wifi from a Linux server.
Packets on which network?

For the DHCP to come over wifi, the HTPC must act as a bridge between wireless and wired. The config would set up that bridge interface and enslave both the wireless and wired NIC to the bridge, and set IP on the bridge by DHCP via wireless. Presumably.

dnsmasq-dhcp[1959]: DHCP, IP range 10.42.0.10 -- 10.42.0.254, lease time 1h
But the laptop doesn't see it.
Routing. The wireless NIC gets IP by DHCP via wireless. The wired NIC has static IP (10.42.0.1?) that is in different subnet than the wireless NIC. The dnsmasq listens only on the wired NIC. The HTPC is configured to route/forward between the subnets, and (probably) masquerade what goes out via wireless NIC. (Masquerade, aka NAT, is not needed, if everyone on the wireless subnet knows static route to 10.42.0.*)

You can listen the wired NIC on the HTPC with 'tcpdump'? Does it show any packets when you connect and boot laptop/streamer with cable?
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,340
4,018
75
Packets on which network?
Well, both. ifconfig says:

Code:
enp0s31f6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.42.0.1  netmask 255.255.255.0  broadcast 10.42.0.255
        inet6 fe80::fbfd:8d98:e97e:ea4  prefixlen 64  scopeid 0x20<link>
        ether 70:8b:cd:82:2a:4f  txqueuelen 1000  (Ethernet)
        RX packets 146  bytes 18385 (18.3 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 161  bytes 16635 (16.6 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xf7200000-f7220000  

...

wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.10  netmask 255.255.255.192  broadcast 192.168.0.63
        inet6 fe80::f37:b6a8:f39:faf3  prefixlen 64  scopeid 0x20<link>
        ether e4:02:9b:e7:e1:3b  txqueuelen 1000  (Ethernet)
        RX packets 8622626  bytes 577577291 (577.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 19940629  bytes 29069549016 (29.0 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The "Shared to other computers" IPV4 setting should set up all the routing. How can I diagnose why it doesn't?
 

mv2devnull

Golden Member
Apr 13, 2010
1,511
149
106
There are two semi-independent questions:

1. What communication occurs between enp0s31f6 and laptop? For that I would use 'tcpdump'.
Does the dnsmasq listen on enp0s31f6?
Does the broadcasted request from DHCP client of laptop arrive to enp0s31f6?
Does the dnsmasq respond?
Does the laptop get an IP? If yes, can it ping the 10.42.0.1?

2. What happens in routing?
Does the firewall allow forwarding?
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,340
4,018
75
I unplugged the laptop (Voyager2) from the HTPC (Ennesby), plugged it back in, and this is what I got from tcpdump:

Code:
tcpdump: listening on enp0s31f6, link-type EN10MB (Ethernet), capture size 262144 bytes
10:14:12.807332 IP6 (hlim 1, next-header Options (0) payload length: 36) :: > ff02::16: HBH (rtalert: 0x0000) (padn) [icmp6 sum ok] ICMP6, multicast listener report v2, 1 group record(s) [gaddr ff02::1:ff7e:ea4 to_ex, 0 source(s)]
10:14:12.811339 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 48, options (RA))
    Ennesby > igmp.mcast.net: igmp v3 report, 2 group record(s) [gaddr 224.0.0.251 to_ex, 0 source(s)] [gaddr 224.0.0.252 to_ex, 0 source(s)]
10:14:12.907583 IP (tos 0x0, ttl 255, id 33228, offset 0, flags [DF], proto UDP (17), length 117)
    Ennesby.mdns > 224.0.0.251.mdns: 0 [2q] [2n] ANY (QM)? 1.0.42.10.in-addr.arpa. ANY (QM)? Ennesby.local. (89)
10:14:12.929259 IP (tos 0x0, ttl 255, id 63967, offset 0, flags [none], proto UDP (17), length 53)
    Ennesby.hostmon > 224.0.0.252.hostmon: UDP, length 25
10:14:12.995961 IP (tos 0x0, ttl 1, id 27907, offset 0, flags [none], proto IGMP (2), length 40, options (RA))
    192.168.137.1 > igmp.mcast.net: igmp v3 report, 1 group record(s) [gaddr 239.255.255.250 to_ex, 0 source(s)]
10:14:13.047380 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 48, options (RA))
    Ennesby > igmp.mcast.net: igmp v3 report, 2 group record(s) [gaddr 224.0.0.251 to_ex, 0 source(s)] [gaddr 224.0.0.252 to_ex, 0 source(s)]
10:14:13.062492 IP (tos 0x0, ttl 255, id 63974, offset 0, flags [none], proto UDP (17), length 53)
    Ennesby.hostmon > 224.0.0.252.hostmon: UDP, length 25
10:15:21.835032 IP (tos 0x0, ttl 255, id 17253, offset 0, flags [none], proto UDP (17), length 145)
    192.168.137.1.mdns > 224.0.0.251.mdns: 0*- [0q] 2/0/2 1.137.168.192.in-addr.arpa. (Cache flush) PTR Voyager2.local., Voyager2.local. (Cache flush) A 192.168.137.1 (117)
10:16:19.220257 IP (tos 0x0, ttl 255, id 17254, offset 0, flags [none], proto UDP (17), length 94)
    192.168.137.1.mdns > 224.0.0.251.mdns: 0 [2q] PTR (QM)? _apple-mobdev._tcp.local. PTR (QM)? _sleep-proxy._udp.local. (66)
10:16:25.841613 IP (tos 0x0, ttl 255, id 17255, offset 0, flags [none], proto UDP (17), length 145)
    192.168.137.1.mdns > 224.0.0.251.mdns: 0*- [0q] 2/0/2 1.137.168.192.in-addr.arpa. (Cache flush) PTR Voyager2.local., Voyager2.local. (Cache flush) A 192.168.137.1 (117)
I'm not sure what any of that means.

Edit: I should mention Voyager2 does not get an IP assigned. 192.168.137.1 being the Windows code for that.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,340
4,018
75
I solved it! I had set up Internet Connection Sharing on my laptop's WiFi too. Even though that adapter was disabled, it was interfering. So it works now. I'll try the streaming box later, but I don't foresee any problems.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |