Ubuntu routing between two interfaces has very low speed











up vote
-1
down vote

favorite












I'm routing traffic from enp5s4f0 (private) to enp7s4f0 (internet)
this is my interfaces file:



internet interface



auto enp7s4f0



iface enp7s4f0 inet static



address 10.192.129.164



netmask 255.255.255.224



gateway 10.192.129.161



private subnet



auto enp5s4f0



iface enp5s4f0 inet static



address 172.1.1.1



netmask 255.255.255.0





  • those are the commands which I'm using for iptables:



    iptables -t nat -A POSTROUTING -o enp7s4f0 -j MASQUERADE



    iptables -A FORWARD -i enp7s4f0 -o enp5s4f0 -m state --state RELATED,ESTABLISHED -j ACCEPT



    iptables -A FORWARD -i enp5s4f0 -o enp7s4f0 -j ACCEPT




I have enabled ip_forwarding successfully and the Nat is successful but it is has very low speed on the servers in private Subnet. Note that the speed is normal at the routing server. Can anyone tell me why the speed is low at this private subnet server please?



This is the speed on the Nat Server:



root@r2s1:~# speedtest
Testing download speed.................................. Download: 89.27 Mbit/s
Testing upload speed............................ Upload: 28.46 Mbit/s


This is the speed on the server behind the Nat:



root@ubuntu:~#
speedtest
Testing download speed........................................ Download: 20.84 Mbit/s
Testing upload speed.................................................. Upload: 1.74 Mbit/s









share|improve this question









New contributor




taym sami is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • I don't know if it will make a difference, but because you have static IP addresses you can use SNAT instead of MASQUERADE: iptables -t nat -A POSTROUTING -o enp7s4f0 -j SNAT --to 10.192.129.164 . Give us some actual values for "very low speed".
    – Doug Smythies
    Nov 13 at 15:29






  • 1




    @DKBose I deleted the duplicated post.
    – taym sami
    Nov 14 at 12:39










  • @DougSmythies Thank you for your kind help. I tried your suggestion but the problem is not solved. this is the speed on the Nat Server: root@r2s1:~# speedtest Testing download speed.................................. Download: 89.27 Mbit/s Testing upload speed............................ Upload: 28.46 Mbit/s - This is the speed on the server behind the Nat: root@ubuntu:~# speedtest Testing download speed........................................ Download: 20.84 Mbit/s Testing upload speed.................................................. Upload: 1.74 Mbit/s
    – taym sami
    Nov 14 at 12:40












  • I don't have a way to test with my system, because I am very upload limited due to my adsl modem.
    – Doug Smythies
    Nov 14 at 16:24










  • @DougSmythies I think the problem will appear for you even if you have a low speed.
    – taym sami
    Nov 15 at 8:32















up vote
-1
down vote

favorite












I'm routing traffic from enp5s4f0 (private) to enp7s4f0 (internet)
this is my interfaces file:



internet interface



auto enp7s4f0



iface enp7s4f0 inet static



address 10.192.129.164



netmask 255.255.255.224



gateway 10.192.129.161



private subnet



auto enp5s4f0



iface enp5s4f0 inet static



address 172.1.1.1



netmask 255.255.255.0





  • those are the commands which I'm using for iptables:



    iptables -t nat -A POSTROUTING -o enp7s4f0 -j MASQUERADE



    iptables -A FORWARD -i enp7s4f0 -o enp5s4f0 -m state --state RELATED,ESTABLISHED -j ACCEPT



    iptables -A FORWARD -i enp5s4f0 -o enp7s4f0 -j ACCEPT




I have enabled ip_forwarding successfully and the Nat is successful but it is has very low speed on the servers in private Subnet. Note that the speed is normal at the routing server. Can anyone tell me why the speed is low at this private subnet server please?



This is the speed on the Nat Server:



root@r2s1:~# speedtest
Testing download speed.................................. Download: 89.27 Mbit/s
Testing upload speed............................ Upload: 28.46 Mbit/s


This is the speed on the server behind the Nat:



root@ubuntu:~#
speedtest
Testing download speed........................................ Download: 20.84 Mbit/s
Testing upload speed.................................................. Upload: 1.74 Mbit/s









share|improve this question









New contributor




taym sami is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • I don't know if it will make a difference, but because you have static IP addresses you can use SNAT instead of MASQUERADE: iptables -t nat -A POSTROUTING -o enp7s4f0 -j SNAT --to 10.192.129.164 . Give us some actual values for "very low speed".
    – Doug Smythies
    Nov 13 at 15:29






  • 1




    @DKBose I deleted the duplicated post.
    – taym sami
    Nov 14 at 12:39










  • @DougSmythies Thank you for your kind help. I tried your suggestion but the problem is not solved. this is the speed on the Nat Server: root@r2s1:~# speedtest Testing download speed.................................. Download: 89.27 Mbit/s Testing upload speed............................ Upload: 28.46 Mbit/s - This is the speed on the server behind the Nat: root@ubuntu:~# speedtest Testing download speed........................................ Download: 20.84 Mbit/s Testing upload speed.................................................. Upload: 1.74 Mbit/s
    – taym sami
    Nov 14 at 12:40












  • I don't have a way to test with my system, because I am very upload limited due to my adsl modem.
    – Doug Smythies
    Nov 14 at 16:24










  • @DougSmythies I think the problem will appear for you even if you have a low speed.
    – taym sami
    Nov 15 at 8:32













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I'm routing traffic from enp5s4f0 (private) to enp7s4f0 (internet)
this is my interfaces file:



internet interface



auto enp7s4f0



iface enp7s4f0 inet static



address 10.192.129.164



netmask 255.255.255.224



gateway 10.192.129.161



private subnet



auto enp5s4f0



iface enp5s4f0 inet static



address 172.1.1.1



netmask 255.255.255.0





  • those are the commands which I'm using for iptables:



    iptables -t nat -A POSTROUTING -o enp7s4f0 -j MASQUERADE



    iptables -A FORWARD -i enp7s4f0 -o enp5s4f0 -m state --state RELATED,ESTABLISHED -j ACCEPT



    iptables -A FORWARD -i enp5s4f0 -o enp7s4f0 -j ACCEPT




I have enabled ip_forwarding successfully and the Nat is successful but it is has very low speed on the servers in private Subnet. Note that the speed is normal at the routing server. Can anyone tell me why the speed is low at this private subnet server please?



This is the speed on the Nat Server:



root@r2s1:~# speedtest
Testing download speed.................................. Download: 89.27 Mbit/s
Testing upload speed............................ Upload: 28.46 Mbit/s


This is the speed on the server behind the Nat:



root@ubuntu:~#
speedtest
Testing download speed........................................ Download: 20.84 Mbit/s
Testing upload speed.................................................. Upload: 1.74 Mbit/s









share|improve this question









New contributor




taym sami is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I'm routing traffic from enp5s4f0 (private) to enp7s4f0 (internet)
this is my interfaces file:



internet interface



auto enp7s4f0



iface enp7s4f0 inet static



address 10.192.129.164



netmask 255.255.255.224



gateway 10.192.129.161



private subnet



auto enp5s4f0



iface enp5s4f0 inet static



address 172.1.1.1



netmask 255.255.255.0





  • those are the commands which I'm using for iptables:



    iptables -t nat -A POSTROUTING -o enp7s4f0 -j MASQUERADE



    iptables -A FORWARD -i enp7s4f0 -o enp5s4f0 -m state --state RELATED,ESTABLISHED -j ACCEPT



    iptables -A FORWARD -i enp5s4f0 -o enp7s4f0 -j ACCEPT




I have enabled ip_forwarding successfully and the Nat is successful but it is has very low speed on the servers in private Subnet. Note that the speed is normal at the routing server. Can anyone tell me why the speed is low at this private subnet server please?



This is the speed on the Nat Server:



root@r2s1:~# speedtest
Testing download speed.................................. Download: 89.27 Mbit/s
Testing upload speed............................ Upload: 28.46 Mbit/s


This is the speed on the server behind the Nat:



root@ubuntu:~#
speedtest
Testing download speed........................................ Download: 20.84 Mbit/s
Testing upload speed.................................................. Upload: 1.74 Mbit/s






networking iptables interface nat traffic






share|improve this question









New contributor




taym sami is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




taym sami is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 14 at 15:58









Doug Smythies

6,93131428




6,93131428






New contributor




taym sami is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 13 at 12:04









taym sami

11




11




New contributor




taym sami is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





taym sami is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






taym sami is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • I don't know if it will make a difference, but because you have static IP addresses you can use SNAT instead of MASQUERADE: iptables -t nat -A POSTROUTING -o enp7s4f0 -j SNAT --to 10.192.129.164 . Give us some actual values for "very low speed".
    – Doug Smythies
    Nov 13 at 15:29






  • 1




    @DKBose I deleted the duplicated post.
    – taym sami
    Nov 14 at 12:39










  • @DougSmythies Thank you for your kind help. I tried your suggestion but the problem is not solved. this is the speed on the Nat Server: root@r2s1:~# speedtest Testing download speed.................................. Download: 89.27 Mbit/s Testing upload speed............................ Upload: 28.46 Mbit/s - This is the speed on the server behind the Nat: root@ubuntu:~# speedtest Testing download speed........................................ Download: 20.84 Mbit/s Testing upload speed.................................................. Upload: 1.74 Mbit/s
    – taym sami
    Nov 14 at 12:40












  • I don't have a way to test with my system, because I am very upload limited due to my adsl modem.
    – Doug Smythies
    Nov 14 at 16:24










  • @DougSmythies I think the problem will appear for you even if you have a low speed.
    – taym sami
    Nov 15 at 8:32


















  • I don't know if it will make a difference, but because you have static IP addresses you can use SNAT instead of MASQUERADE: iptables -t nat -A POSTROUTING -o enp7s4f0 -j SNAT --to 10.192.129.164 . Give us some actual values for "very low speed".
    – Doug Smythies
    Nov 13 at 15:29






  • 1




    @DKBose I deleted the duplicated post.
    – taym sami
    Nov 14 at 12:39










  • @DougSmythies Thank you for your kind help. I tried your suggestion but the problem is not solved. this is the speed on the Nat Server: root@r2s1:~# speedtest Testing download speed.................................. Download: 89.27 Mbit/s Testing upload speed............................ Upload: 28.46 Mbit/s - This is the speed on the server behind the Nat: root@ubuntu:~# speedtest Testing download speed........................................ Download: 20.84 Mbit/s Testing upload speed.................................................. Upload: 1.74 Mbit/s
    – taym sami
    Nov 14 at 12:40












  • I don't have a way to test with my system, because I am very upload limited due to my adsl modem.
    – Doug Smythies
    Nov 14 at 16:24










  • @DougSmythies I think the problem will appear for you even if you have a low speed.
    – taym sami
    Nov 15 at 8:32
















I don't know if it will make a difference, but because you have static IP addresses you can use SNAT instead of MASQUERADE: iptables -t nat -A POSTROUTING -o enp7s4f0 -j SNAT --to 10.192.129.164 . Give us some actual values for "very low speed".
– Doug Smythies
Nov 13 at 15:29




I don't know if it will make a difference, but because you have static IP addresses you can use SNAT instead of MASQUERADE: iptables -t nat -A POSTROUTING -o enp7s4f0 -j SNAT --to 10.192.129.164 . Give us some actual values for "very low speed".
– Doug Smythies
Nov 13 at 15:29




1




1




@DKBose I deleted the duplicated post.
– taym sami
Nov 14 at 12:39




@DKBose I deleted the duplicated post.
– taym sami
Nov 14 at 12:39












@DougSmythies Thank you for your kind help. I tried your suggestion but the problem is not solved. this is the speed on the Nat Server: root@r2s1:~# speedtest Testing download speed.................................. Download: 89.27 Mbit/s Testing upload speed............................ Upload: 28.46 Mbit/s - This is the speed on the server behind the Nat: root@ubuntu:~# speedtest Testing download speed........................................ Download: 20.84 Mbit/s Testing upload speed.................................................. Upload: 1.74 Mbit/s
– taym sami
Nov 14 at 12:40






@DougSmythies Thank you for your kind help. I tried your suggestion but the problem is not solved. this is the speed on the Nat Server: root@r2s1:~# speedtest Testing download speed.................................. Download: 89.27 Mbit/s Testing upload speed............................ Upload: 28.46 Mbit/s - This is the speed on the server behind the Nat: root@ubuntu:~# speedtest Testing download speed........................................ Download: 20.84 Mbit/s Testing upload speed.................................................. Upload: 1.74 Mbit/s
– taym sami
Nov 14 at 12:40














I don't have a way to test with my system, because I am very upload limited due to my adsl modem.
– Doug Smythies
Nov 14 at 16:24




I don't have a way to test with my system, because I am very upload limited due to my adsl modem.
– Doug Smythies
Nov 14 at 16:24












@DougSmythies I think the problem will appear for you even if you have a low speed.
– taym sami
Nov 15 at 8:32




@DougSmythies I think the problem will appear for you even if you have a low speed.
– taym sami
Nov 15 at 8:32















active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






taym sami is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1092537%2fubuntu-routing-between-two-interfaces-has-very-low-speed%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes








taym sami is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















taym sami is a new contributor. Be nice, and check out our Code of Conduct.













taym sami is a new contributor. Be nice, and check out our Code of Conduct.












taym sami is a new contributor. Be nice, and check out our Code of Conduct.















 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1092537%2fubuntu-routing-between-two-interfaces-has-very-low-speed%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents