Page 1 of 1

making routes using config files

Posted: 2021/03/04 21:03:17
by OpenCopperPour
i try to figure out how to control traffic between 4 virtual machines using routing, preferably using configfiles instead of issuing commands in terminal.
Can i be told where i go wrong please?

VMs network map.txt
(3.23 KiB) Downloaded 255 times

Step by step of what i tried:

I try to set all ip:s by editing

Then i edit
net.ifv4.ip_forward = 0
net.ifv4.ip_forward = 1

Then either restart the VM or issue "service network restart" in terminal
Seems to be working.

Flush all iptables rules i know of by issuing
iptables -t raw -F
iptables -t security -F
iptables -t filter -F
iptables -t nat -F
iptables -t mangle -F

(Not a permanent solution.)

Add the file
And alike for other nics
containing via dev eth2

Don't work.

So i issue
ip route add via dev eth
this works.

tho i seem to be able to route trough 3 machines but not 4.
I cannot figure out where i go wrong.

Any ideas?

Re: making routes using config files

Posted: 2021/03/05 17:32:18
by TrevorH
This doesn't look like it's for CentOS 6 which is the forum you've posted in. Since the ways in which you do this are different on 6 7 and 8, please clarify which CentOS version you are using so that one of us can move this to the correct forum for you.

Re: making routes using config files

Posted: 2021/03/05 18:43:21
by OpenCopperPour
It is actually CentOS 6.10 i'm using on all 4 machines, tho i might have read guides that isnt really CentOS 6.

Can i ask what look like other versions?
Maybe i'll figure out where i go wrong from there.

I'm pretty sure the problem is between the keyboard and chair :D

Noticed your signature about CentOS 6 being dead since november 2020, using 6.10 due to memory constraints.

Re: making routes using config files

Posted: 2021/03/05 18:54:14
by TrevorH
Are you using NetworkManager or the network service? Run rpm -qa NetworkManager\* to find out. It works easily without NM but on the ancient version of NM that was in el6, it's probably a struggle.

Don't forget that you shouldn't be using 6 at all any more. It's EOL and there will be no more updates to it and there are already unfixed serious secrutity problems with it.

Re: making routes using config files

Posted: 2021/03/05 21:49:26
by OpenCopperPour
That gave me, seems like i'm using Networkmanager then i guess.

[root@localhost ~]# rpm -qa NetworkManager\*
[root@localhost ~]#

Turned it off, messed things up, had to turn it back on because i didn't manage to set IPs and routes on my own :D
Trying again after a shower.

Re: making routes using config files

Posted: 2021/03/06 01:03:25
by TrevorH
I've shut down my CentOS 6 VM so cannot look. Does yum install NetworkManager-dispatcher-routing-rules work? I'm not sure if NM in CentOS 6 had that package or its functionality.

Re: making routes using config files

Posted: 2021/03/06 09:22:19
by jlehtone
The Vault (for 6) does not have NetworkManager-dispatcher-routing-rules. Overall, the NetworkManager for 6 was seriously limited in features. It was about RHEL 7.3 when NM got "sufficient" coverage.

CentOS 6 has two services, 'NetworkManager' and 'network', to configure connections. Both store their config in
the /etc/sysconfig/network-scripts/ifcfg-* files. Both have some GUI/TUI/CLI tools to modify those files.
It is possible (and was common) to modify the files by hand (text editor), but then you have to know the
syntax/format of the files.

Static routes are in separate files. There are two different syntaxes for those files.
I did actually chose an another route: I did set the DHCP server to offer the static routes to clients.
No need for files in clients then.

Why do you seem to have a router in the middle of 192.168.2.x/y ?