LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Network settings for a Fedora29 Server with two networkcards to act as a router to the internet for my Fedora29 Workstation (https://www.linuxquestions.org/questions/linux-networking-3/network-settings-for-a-fedora29-server-with-two-networkcards-to-act-as-a-router-to-the-internet-for-my-fedora29-workstation-4175644451/)

jooseph 12-17-2018 07:22 AM

Network settings for a Fedora29 Server with two networkcards to act as a router to the internet for my Fedora29 Workstation
 
what basic network settings will make my Fedora 29 Server with two network cards act as a router to the internet for my Fedora 29 Workstation?

I prefer to use basic tools only, i.e. static IP configuration (no dhcp), no DNS and no virtual machines.

Many thanks for any tips :hattip:


network settings of my router are:

ip addr show:
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:0e:c4:ce:3a:0d brd ff:ff:ff:ff:ff:ff
inet 10.0.0.1/24 brd 10.0.0.255 scope global noprefixroute enp2s0 valid_lft forever preferred_lft forever
3: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:0e:c4:ce:3a:0e brd ff:ff:ff:ff:ff:ff
inet 217.xxx.144.28/29 brd 217.xxx.144.31 scope global noprefixroute enp3s0 valid_lft forever preferred_lft forever

ip route show:
default via 217.xxx.144.25 dev enp3s0 proto static metric 100
10.0.0.0/24 dev enp2s0 proto kernel scope link src 10.0.0.1 metric 101
217.xxx.144.24/29 dev enp3s0 proto kernel scope link src 217.xxx.144.28 metric 100


sysctl net.ipv4.ip_forward:
net.ipv4.ip_forward = 1


network settings of my workstation are:

ip addr show:
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 50:7b:9d:be:75:d9 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.3/24 brd 10.0.0.255 scope global noprefixroute enp0s31f6 valid_lft forever preferred_lft forever


ip route show:
default via 10.0.0.1 dev enp0s31f6 proto static metric 20100
10.0.0.0/24 dev enp0s31f6 proto kernel scope link src 10.0.0.3 metric 100

sysctl net.ipv4.ip_forward:
net.ipv4.ip_forward = 1

berndbausch 12-17-2018 07:46 AM

There are many tutorials out there. Your favourite search engine knows how to find them, for example router fedora gives you a long list including https://fedoramagazine.org/use-fedor...outer-gateway/.

jooseph 12-17-2018 09:38 AM

Thank you for you reply, I'm aware of https://fedoramagazine.org/use-fedor...outer-gateway/. The example assumes a specific Internet provider, pushes into using extra tools and doesn't bring a working solution

michaelk 12-17-2018 11:41 AM

If your router machine is running a desktop using the firewall-config GUI configuration tool might be easier to use then the command line. Here is guide using CentOS 7 but the steps should be the same.

In summary you need to define which interface is external and which is internal and add rules to forward from internal to external and masquerade to perform NAT from external to internal.

https://linuxize.com/post/how-to-set...d-on-centos-7/

jooseph 12-18-2018 01:42 AM

Dear michaelk, thank you for your tips. It works!


All times are GMT -5. The time now is 06:28 PM.