I have several computers connected into a network with Fedora Server installed:

enter image description here

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 Settings and select Shared to other computers

As result:

  • 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:

  1. parprouted eth0 wlan0
    sysctl net.ipv4.ip_forward=1
  2. 2.
ip addr add dev eth0
iptables -A FORWARD -o wlan0 -i eth0 -s -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

Neither worked.


All I needed to do is:

Edit /etc/sysconfig/network-script/ifcfg-"name_of_interface". Find there a lines with parameters:

  • BOOTPROTO and set it to BOOTPROTO=shared
  • IPV6_AUTOCONF and set it as IPV6_AUTOCONF=shared
  • IPV6_PRIVACY and set it asIPV6_PRIVACY=no

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.