<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Chris,</p>
<p> Your server is connected to two subnets one of them has the
default gateway through eth0 (in the direction of your clients).
When you add a new route for 10.0.0.0/20 through eth1 then all
10.0.0.0/20 traffic is going to go though that interface including
10.0.0.0/22 since the latter is a subset of the former. You still
have a default gateway through eth0 but the route you add is
going to be selected for 10.0.0.0/22 since it is more specific
(preferred by the kernel) than the default route. you either
narrow down the route you add or just add a new route to force
10.0.0.0/22 to still go through eth0. Using iproute2 commands here
is what I'd do:<br>
</p>
<p><br>
</p>
<p>ip route add 10.0.0.0/22 dev eth0 via 172.31.0.1<br>
</p>
<p>ip route add 10.0.0.0/20 dev eth1 via 172.31.80.1</p>
<p><br>
</p>
<p>--Jafar</p>
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 07/26/2018 01:45 PM, Christian
Salway wrote:<br>
</div>
<blockquote type="cite"
cite="mid:E2FEDDFB-AFC8-44E1-A940-6851450F0918@naimuri.com">
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
I'm having trouble getting routing to work.
<div class=""><br class="">
</div>
<div class="">I have the following setup</div>
<div class=""><br class="">
</div>
<div style="orphans: 2; widows: 2;" class="">10.0.0.0/22 (clients)
>> <span style="color: rgb(68, 68, 68); font-family:
"Helvetica Neue", Roboto, Arial, sans-serif;
font-size: 13px; orphans: 2; widows: 2; background-color:
rgb(255, 255, 255);" class="">35.178.182.221 (aws elastic ip)
>> | </span><font class="" color="#444444" size="2"
face="Helvetica Neue, Roboto, Arial, sans-serif"><span
style="caret-color: rgb(68, 68, 68);" class="">172.31.0.17
(eth0) > 172.31.92.251 (eth1) | >> 10.0.0.0/20
(remote network)</span></font></div>
<div style="orphans: 2; widows: 2;" class=""><br class="">
</div>
<div style="orphans: 2; widows: 2;" class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">$
route -n</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">Kernel
IP routing table</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">Destination
Gateway Genmask Flags Metric Ref Use
Iface</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">0.0.0.0
172.31.0.1 0.0.0.0 UG 0 0
0 eth0</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">172.31.0.0
0.0.0.0 255.255.240.0 U 0 0 0
eth0</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">172.31.80.0
0.0.0.0 255.255.240.0 U 0 0 0
eth1</span></div>
</div>
<div style="margin: 0px; font-stretch: normal; line-height:
normal; background-color: rgb(255, 255, 255);" class=""><br
class="">
</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span style="font-family:
Helvetica; font-size: 12px;" class=""><br class="">
</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span style="font-family:
Helvetica; font-size: 12px;" class="">If I add the following
route manually, it allows me to connect from the server, but i
cant get clients to route through.</span><br
style="font-family: Helvetica; font-size: 12px;" class="">
<br style="font-family: Helvetica; font-size: 12px;" class="">
<div style="font-family: Helvetica; font-size: 12px; margin:
0px; font-stretch: normal; line-height: normal;" class="">
<div style="margin: 0px; font-stretch: normal; font-size:
11px; line-height: normal; font-family: Menlo;" class=""><span
style="font-variant-ligatures: no-common-ligatures"
class="">route add -net 10.0.0.0/20 gateway 172.31.80.1
eth1</span></div>
</div>
<div class=""><font class="" face="Menlo"><span
style="font-size: 11px;" class=""><br class="">
</span></font></div>
<div class="">
<div style="margin: 0px; font-stretch: normal; line-height:
normal;" class=""><span style="font-variant-ligatures:
no-common-ligatures" class="">$ route -n</span></div>
<div style="margin: 0px; font-stretch: normal; line-height:
normal;" class=""><span style="font-variant-ligatures:
no-common-ligatures" class="">Kernel IP routing table</span></div>
<div style="margin: 0px; font-stretch: normal; line-height:
normal;" class=""><span style="font-variant-ligatures:
no-common-ligatures" class="">Destination Gateway
Genmask Flags Metric Ref Use Iface</span></div>
<div style="margin: 0px; font-stretch: normal; line-height:
normal;" class=""><span style="font-variant-ligatures:
no-common-ligatures" class="">0.0.0.0 172.31.0.1
0.0.0.0 UG 0 0 0 eth0</span></div>
<div style="margin: 0px; font-stretch: normal; line-height:
normal;" class=""><span style="font-variant-ligatures:
no-common-ligatures" class="">10.0.0.0 172.31.80.1
255.255.240.0 UG 0 0 0 eth1</span></div>
<div style="margin: 0px; font-stretch: normal; line-height:
normal;" class=""><span style="font-variant-ligatures:
no-common-ligatures" class="">172.31.0.0 0.0.0.0
255.255.240.0 U 0 0 0 eth0</span></div>
<div style="margin: 0px; font-stretch: normal; line-height:
normal;" class=""><span style="font-variant-ligatures:
no-common-ligatures" class="">172.31.80.0 0.0.0.0
255.255.240.0 U 0 0 0 eth1</span></div>
</div>
<div style="margin: 0px; font-stretch: normal; line-height:
normal;" class=""><span style="font-variant-ligatures:
no-common-ligatures" class=""><br class="">
</span></div>
<div style="margin: 0px; font-stretch: normal; line-height:
normal;" class="">
<div style="font-family: Helvetica; font-size: 12px;" class="">What
am i missing??</div>
<div class=""><br class="">
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>