i am quite new in this area, so in case you need clarification please ask me more as there is a chance for me not to describe correctly the problem.
Let's asume i have this scenario :
- Public ip 5.2.162.266/21 and gateway 5.2.160.1 on gateway named : enp4s1
- Private ip 192.168.0.100 and gateway 192.168.0.1 on gateway named : enp2s0
here i have the details on enp2s0 :
cat ifcfg-enp2s0
TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="no"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="enp2s0"
DEVICE="enp2s0"
ONBOOT="yes"
DNS1="8.8.8.8"
DNS2="4.2.2.4"
IPADDR=192.168.0.100
PREFIX=24
GATEWAY=192.168.0.1
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_PRIVACY=no
and for enp4s1 :
cat ifcfg-enp4s1
TYPE=Ethernet
BOOTPROTO=static
DNS1=8.8.8.8
DNS2=4.2.2.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=enp4s1
ONBOOT=yes
MTU=1440
IPADDR=5.2.162.266
PREFIX=21
GATEWAY=5.2.160.1
DEVICE="enp4s1"
( i would like to have separate routes for them and not to use as DEFROUTE enp4s1 )
I don't need a default gateway. I need requests from public ip to be answered by it's gateway and local requests to be resolved locally.
How can i achieve this type of routing?
Thank you helping buddy!