I have this network (network structure picture):
I need to configure the Kylin laptop to let other clients (PC, phones) access Internet. I have 3 USB ethernet adapter (enx000ec6c5afc1, enx00e04c68009b, enx00e04ca01003) plugged in the Kylin. I want all the clients to be in the same subnet to use RPI as second gateway. I tried to bridge the 3 USB Ethernet adapters together as br-lan, and configure DHCP and iptables to it.
This is my configuration:
# /etc/network/interfaces
auto br-lan
iface br-lan inet static
bridge_ports enx000ec6c5afc1 enx00e04c68009b enx00e04ca01003
address 192.168.1.1/24
# /etc/dhcp/dhcpd.conf
# I already bind the MACs of AP, PC, RPI to static IPs
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.5 192.168.1.240;
option domain-name-servers 8.8.8.8;
option subnet-mask 255.255.255.0;
option routers 192.168.1.1;
option broadcast-address 192.168.1.255;
default-lease-time 86400;
max-lease-time 259200;
}
iptables -A FORWARD -i enp1s0 -o br-lan -j ACCEPT
iptables -A FORWARD -i br-lan -o enp1s0 -j ACCEPT
iptables -A POSTROUTING -o enp1s0 -j MASQUERADE
The dhcpd seems working fine, all the clients can get correct IPs. But either PC or RPI can access Internet, no success for both. Any client behind AP seems always fine.
Before all this I just use different subnets for different USB adapters (PC: 192.168.2.X, AP: 192.168.1.X, RPI: 192.168.4.X), then configure dhcp/iptables for each subnet/adapter. It works fine.
Is there anything I configured wrong?
I already bind the MACs of AP, PC, RPI to static IPs
Do you mean like DHCP reservation or you literally configure IP manually on them? Are you sure they received the same kind of configuration (from either you or the DHCP server), like default route/gateway and DNS server not missing and correct?tracert -d 8.8.8.8
run from Win10 PChost PC { hardware ether xx:xx...(copied from lease file); fixed-address 192.168.1.3; }
The gateway, dns and other info like domain-name are all correct. But I can't even ping 192.168.1.1 on PC (timeout). I do have another WiFi PCIe card on the PC. I only enable one of the two adapters (ether or wifi) during test. WiFi connects to AP22 and works fine. Another interesting behavior is that when I enable the ether adapter on PC, the browsers stopped responding for a while (both Firefox and Edge, sometimes even VScode)