Change source of packet in a multihomed machine

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I got one server. this server has two interfaces named enp30s0 and enp31s0.



enp30s0 is connected to a modem to internet with the IP address 10.66.64.130



enp31s0 is connected to a huge Lan with lots and lots of subnetworks like 10.66.0.1 10.66.1.1 10.66.2.1 and so on, with the IP address 192.168.0.106.



I got a second route table to add the gateway of enp31s0 so other subnetworks can see me.



###RUTE TABLE###
post-up ip route add 10.66.64.0/24 dev enp31s0 src 10.66.64.130 table rt2
post-up ip route add default via 10.66.64.254 dev enp31s0 table rt2
post-up ip rule add from 10.66.64.130/32 table rt2
post-up ip rule add to 10.66.64.130/32 table rt2


Everything works but if from the server I do something like a



ping 10.66.0.165 


the server goes through the enp30s0 and not through enp31s0.



 1?: [LOCALHOST] pmtu 1500
1: 192.168.0.1 3.226ms
1: 192.168.0.1 0.489ms
2: 192.168.1.254 1.538ms
3: 192.168.1.254 1.343ms pmtu 1492


I need that the address from the server to 10...* goes through enp31s0.



How can i achieve that?










share|improve this question























  • Please invest some time on writing your questions.
    – Rui F Ribeiro
    Aug 7 at 23:42










  • I know this is a duplicate....not finding it.
    – Rui F Ribeiro
    Aug 7 at 23:44










  • Thanks for your time. First question and not familiar with the site.
    – skyark
    Aug 8 at 0:44










  • @RuiFRibeiro - I think dirkt wrote this up - unix.stackexchange.com/questions/457270/….
    – slm♦
    Aug 8 at 3:19






  • 1




    @slm There is something else, but that might do, depending on situation. I have not yet though well about the question, and today wont be probably a day for it.
    – Rui F Ribeiro
    Aug 8 at 6:00














up vote
0
down vote

favorite












I got one server. this server has two interfaces named enp30s0 and enp31s0.



enp30s0 is connected to a modem to internet with the IP address 10.66.64.130



enp31s0 is connected to a huge Lan with lots and lots of subnetworks like 10.66.0.1 10.66.1.1 10.66.2.1 and so on, with the IP address 192.168.0.106.



I got a second route table to add the gateway of enp31s0 so other subnetworks can see me.



###RUTE TABLE###
post-up ip route add 10.66.64.0/24 dev enp31s0 src 10.66.64.130 table rt2
post-up ip route add default via 10.66.64.254 dev enp31s0 table rt2
post-up ip rule add from 10.66.64.130/32 table rt2
post-up ip rule add to 10.66.64.130/32 table rt2


Everything works but if from the server I do something like a



ping 10.66.0.165 


the server goes through the enp30s0 and not through enp31s0.



 1?: [LOCALHOST] pmtu 1500
1: 192.168.0.1 3.226ms
1: 192.168.0.1 0.489ms
2: 192.168.1.254 1.538ms
3: 192.168.1.254 1.343ms pmtu 1492


I need that the address from the server to 10...* goes through enp31s0.



How can i achieve that?










share|improve this question























  • Please invest some time on writing your questions.
    – Rui F Ribeiro
    Aug 7 at 23:42










  • I know this is a duplicate....not finding it.
    – Rui F Ribeiro
    Aug 7 at 23:44










  • Thanks for your time. First question and not familiar with the site.
    – skyark
    Aug 8 at 0:44










  • @RuiFRibeiro - I think dirkt wrote this up - unix.stackexchange.com/questions/457270/….
    – slm♦
    Aug 8 at 3:19






  • 1




    @slm There is something else, but that might do, depending on situation. I have not yet though well about the question, and today wont be probably a day for it.
    – Rui F Ribeiro
    Aug 8 at 6:00












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I got one server. this server has two interfaces named enp30s0 and enp31s0.



enp30s0 is connected to a modem to internet with the IP address 10.66.64.130



enp31s0 is connected to a huge Lan with lots and lots of subnetworks like 10.66.0.1 10.66.1.1 10.66.2.1 and so on, with the IP address 192.168.0.106.



I got a second route table to add the gateway of enp31s0 so other subnetworks can see me.



###RUTE TABLE###
post-up ip route add 10.66.64.0/24 dev enp31s0 src 10.66.64.130 table rt2
post-up ip route add default via 10.66.64.254 dev enp31s0 table rt2
post-up ip rule add from 10.66.64.130/32 table rt2
post-up ip rule add to 10.66.64.130/32 table rt2


Everything works but if from the server I do something like a



ping 10.66.0.165 


the server goes through the enp30s0 and not through enp31s0.



 1?: [LOCALHOST] pmtu 1500
1: 192.168.0.1 3.226ms
1: 192.168.0.1 0.489ms
2: 192.168.1.254 1.538ms
3: 192.168.1.254 1.343ms pmtu 1492


I need that the address from the server to 10...* goes through enp31s0.



How can i achieve that?










share|improve this question















I got one server. this server has two interfaces named enp30s0 and enp31s0.



enp30s0 is connected to a modem to internet with the IP address 10.66.64.130



enp31s0 is connected to a huge Lan with lots and lots of subnetworks like 10.66.0.1 10.66.1.1 10.66.2.1 and so on, with the IP address 192.168.0.106.



I got a second route table to add the gateway of enp31s0 so other subnetworks can see me.



###RUTE TABLE###
post-up ip route add 10.66.64.0/24 dev enp31s0 src 10.66.64.130 table rt2
post-up ip route add default via 10.66.64.254 dev enp31s0 table rt2
post-up ip rule add from 10.66.64.130/32 table rt2
post-up ip rule add to 10.66.64.130/32 table rt2


Everything works but if from the server I do something like a



ping 10.66.0.165 


the server goes through the enp30s0 and not through enp31s0.



 1?: [LOCALHOST] pmtu 1500
1: 192.168.0.1 3.226ms
1: 192.168.0.1 0.489ms
2: 192.168.1.254 1.538ms
3: 192.168.1.254 1.343ms pmtu 1492


I need that the address from the server to 10...* goes through enp31s0.



How can i achieve that?







networking route interface gateway ip-address






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 7 at 23:40









Rui F Ribeiro

36.5k1271116




36.5k1271116










asked Aug 7 at 22:29









skyark

11




11











  • Please invest some time on writing your questions.
    – Rui F Ribeiro
    Aug 7 at 23:42










  • I know this is a duplicate....not finding it.
    – Rui F Ribeiro
    Aug 7 at 23:44










  • Thanks for your time. First question and not familiar with the site.
    – skyark
    Aug 8 at 0:44










  • @RuiFRibeiro - I think dirkt wrote this up - unix.stackexchange.com/questions/457270/….
    – slm♦
    Aug 8 at 3:19






  • 1




    @slm There is something else, but that might do, depending on situation. I have not yet though well about the question, and today wont be probably a day for it.
    – Rui F Ribeiro
    Aug 8 at 6:00
















  • Please invest some time on writing your questions.
    – Rui F Ribeiro
    Aug 7 at 23:42










  • I know this is a duplicate....not finding it.
    – Rui F Ribeiro
    Aug 7 at 23:44










  • Thanks for your time. First question and not familiar with the site.
    – skyark
    Aug 8 at 0:44










  • @RuiFRibeiro - I think dirkt wrote this up - unix.stackexchange.com/questions/457270/….
    – slm♦
    Aug 8 at 3:19






  • 1




    @slm There is something else, but that might do, depending on situation. I have not yet though well about the question, and today wont be probably a day for it.
    – Rui F Ribeiro
    Aug 8 at 6:00















Please invest some time on writing your questions.
– Rui F Ribeiro
Aug 7 at 23:42




Please invest some time on writing your questions.
– Rui F Ribeiro
Aug 7 at 23:42












I know this is a duplicate....not finding it.
– Rui F Ribeiro
Aug 7 at 23:44




I know this is a duplicate....not finding it.
– Rui F Ribeiro
Aug 7 at 23:44












Thanks for your time. First question and not familiar with the site.
– skyark
Aug 8 at 0:44




Thanks for your time. First question and not familiar with the site.
– skyark
Aug 8 at 0:44












@RuiFRibeiro - I think dirkt wrote this up - unix.stackexchange.com/questions/457270/….
– slm♦
Aug 8 at 3:19




@RuiFRibeiro - I think dirkt wrote this up - unix.stackexchange.com/questions/457270/….
– slm♦
Aug 8 at 3:19




1




1




@slm There is something else, but that might do, depending on situation. I have not yet though well about the question, and today wont be probably a day for it.
– Rui F Ribeiro
Aug 8 at 6:00




@slm There is something else, but that might do, depending on situation. I have not yet though well about the question, and today wont be probably a day for it.
– Rui F Ribeiro
Aug 8 at 6:00















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461176%2fchange-source-of-packet-in-a-multihomed-machine%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461176%2fchange-source-of-packet-in-a-multihomed-machine%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?