I have several computers connected into a network with Fedora Server installed:
Where one computer has 2 interfaces: WiFi and Ethernet.
- WiFi is used for outer network access (and Internet too).
- Ethernet is used for connection to network switch and to other computers connected to this switch.
I need to allow internet access for all computers connected to switch. To achieve, what I need I do following:
- during installation from USB-live I select the WiFi network
- after that I select the Ethernet interface, go to
IPv4 Settingsand select
Shared to other computers
- This computer automatically shares Internet access to other computers connected to switch
- Each freshly connected computer to switch automatically obtains it own IP address in the same subnet as computer with WiFi
How to achieve the same using terminal?
I found and tried several options:
parprouted eth0 wlan0 sysctl net.ipv4.ip_forward=1
sudo ip addr add 192.168.0.1/24 dev eth0 iptables -A FORWARD -o wlan0 -i eth0 -s 192.168.0.0/24 -m conntrack --ctstate NEW -j ACCEPT sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT sudo iptables -t nat -F POSTROUTING sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE