0

I was previously using Windows 7 to to share wireless internet to a device without wireless capability over Ethernet, and it worked perfectly.

I've now switched to a Linux machine and am trying to do the same, however the results are extremely shaky. For example, when using the client machine using the shared connection and with Windows sharing, Netflix runs fine, when using Linux to share, Netflix buffers every few minutes.

All Ethernet interfaces are using static addresses.

All I did to setup Linux to act as a gateway in this manner was:

iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sysctl net.ipv4.ip_forward=1

Is there anything else I can do to improve the connection?

0

I have a machine doing almost exactly what you're talking about, only it's wireless on one side (17.16.0.0/24) and staticly-addressed ethernet on the other. Works perfectly fine.

/usr/bin/ip link set dev wlp1s0 up
/usr/bin/ip addr add 172.16.0.1/24 dev wlp1s0
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 172.16.0.0/24 -j MASQUERADE
iptables -A FORWARD -o enp4s8 -i wlp1s0 -s 172.16.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
dhcpd -cf /etc/dhcpd.wlp1s0.conf wlp1s0

The only difference I can see in the iptables setup is this: iptables -t nat -A POSTROUTING -s 172.16.0.0/24 -j MASQUERADE but I can also see in my personal examples having done it exactly as you have.

Do you have DNS setup on both machines correctly? Some "internet failures" are problems with DNS alone, and long apparent "timeouts" or "inability" to connect is often associated with some DNS setup problems.

You might also check the cabling - are all plugs really inserted, or are they a little loose?

You could try mii-tool on the intermediate box to see if you're getting the fastest possible full-duplex connection. A cable that's half broken can end up doing half-duplex, or slower rates than a good cable.

  • It's definitely not a physical connection problem. The connection works, just not as well on Windows. This is very odd to me, since in my experience in the past they both worked perfectly. Are there any kernel level optimizations that I might need to make that could solve this issue? – John Sanders Oct 26 '15 at 2:13
  • Not to my knowledge. I still think you should double check the cabling, and do mii-tool on the ethernet devices to see what they say. Might surprise you. Also, double check your DNS. – Bruce Ediger Oct 26 '15 at 13:02
  • There isn't any way it could be a physical connection issue. It works flawlessly over windows, and stutters over linux. I am running both from a VM, so I never even unplug the cable...it doesn't change in any way. – John Sanders Oct 26 '15 at 23:06
  • @JohnSanders - the "VM" part would have been good to know at the beginning. The next thing is "what operating system are the VMs running in?" – Bruce Ediger Oct 26 '15 at 23:35
  • Honestly, that's irrelevant. I can start up my laptop with a livecd distro, so it isn't in a VM, and I have the exact same issue. It's not a physical connection issue, and it's not because it's running in a VM. – John Sanders Oct 27 '15 at 3:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.