Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6417

Forward (share) network to a bridged interface of 3 adapters

$
0
0

I have a network like this:network structure pictureI need to configure the Kylin laptop to let other clients(PC, phones) access internet. I have 3 USB ethernet adapter (enx000ec6c5afc1, enx00e04c68009b, enx00e04ca01003) pluged in the Kylin. I want all the clients to be in the same subnet (to use RPI as second gateway).So I tried to bridge the 3 USB eth adapter together as br-lan, and configure dhcp and iptables to it.

This is my configuration:

# /etc/network/interfacesauto br-laniface 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 IPssubnet 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 ACCEPTiptables -A FORWARD -i br-lan -o enp1s0 -j ACCEPTiptables -A POSTROUTING -o enp1s0 -j MASQUERADE

The dhcpd seems working fine, all the clients can get correct IPs. But either PC or RPI cannot access internet. 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?


Viewing all articles
Browse latest Browse all 6417

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>