O
O
Oleg Kulackovich2017-10-28 17:14:46
linux
Oleg Kulackovich, 2017-10-28 17:14:46

How to set up routing on a server under CentOS 7?

Good day!
I set up a home server according to this article
. However, something went wrong. Started from scratch.
Given:
CentOS7-minimal,
Dell Dimension 4300 with two network cards:
eth1(192.168.0.203) - "looks" at the provider's side;
eth0(192.168.1.200) - "looks" into the local network.
How to set up routing on the server so that the local network, having an eth0 gateway, gains access to the world?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Plotnikov, 2017-10-28
@lucid_lynxx

You also need to know the address of the gateway (router) on the provider's side.
1. Enable routing:
- temporary option until reboot: from the command line echo 1 > /proc/sys/net/ipv4/ip_forward (naturally under root or with sudo)
- permanent option: add the line to the /etc/sysctl.conf file net.ipv4.ip_forward = 1 and reload or command sysctl -p
2. Specify default route: route add default gw <provider gateway address>

R
Riz66, 2017-12-09
@Riz66

For some reason, forwarding was not applied to all interfaces (net.ipv4.ip_firwarding=1)
True, I configured the grid through systemd-networkd.
Forced the IPForwarding=yes
man systemd.network option for each interface to help

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question