Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 01-24-2015, 02:28 AM   #1
LQ Newbie
Registered: Jan 2015
Posts: 2

Rep: Reputation: Disabled
slow NAT using iptables

I have a computer (Lenovo S10-3 netbook with 2GB RAM and intel atom N550 dual core CPU). This computer is connected to the internet via WiFi using USB WLAN (TP-Link, I forget the exact type. It is a high gain USB WLAN adapter and using an atheros chipset). This adapter name is wlp0s29f7u3. This adapter IP address is

I share this computer internet to this computer's the ethernet adapter (Realtek chipset) with the name enp5s0. This adapter IP address is

The computer that access this computer's internet connection is connected to the same switch with this computer, and is configured with IP address and default gateway set to

What i've done first is flush the iptable data :
iptables -F
iptables -t nat -F
Then I activate the rule using :
iptables -t nat -A POSTROUTING -o wlp0s29f7u3 -j MASQUERADE
iptables -A FORWARD -i enp5s0 -j ACCEPT
This worked perfectly, except that when I access the internet using the computer with IP address, The speed varies between 3 to 3.5 mbps (I tested this via wget to download a file from my web hosting). Whereas on this computer (the one who share the internet) can download the exact same URL with about 12 mbps speed. This method of sharing doesn't slow down ping, only slow down bandwidth.

I checked the connection from to using FTP, and it worked fine (80mbps to 90mbps, since it is a 100 mbps switch).

FYI, this happens both in ubuntu 14.04 64 bit or CentOS 7 64 bit.

Please help me. Thank you for your assistance.
I am sorry for my bad English, since I am not a native speaker. And I also sorry if this post is inappropriate, since I am a complete linux newbie.

Last edited by hendratapaulus; 01-24-2015 at 04:03 AM.
Old 01-26-2015, 09:39 AM   #2
LQ Newbie
Registered: Jan 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
problem solved

Well, it seems a kernel-related problem. After changing my distro to ubuntu 14.10 (linux 3.16 kernel), previously ubuntu 14.04 which uses 3.13 kernel and CentOS 7 which uses 3.10 kernel, my problem solved.
Thanks everyone!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables: can't initialize iptables table `NAT' linuxgentoo Linux - Kernel 3 01-17-2010 10:15 AM
Slow Linux NAT get00x Linux - Networking 10 06-03-2009 04:11 PM
Slow downloads through iptables NAT sglow Linux - Networking 14 06-05-2004 12:18 PM
IPTABLES : build NAT using IPTABLES joseph Linux - Networking 4 04-23-2004 05:08 AM
slow connection through iptables/nat rellick Linux - Networking 7 03-18-2004 11:24 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration