Popular Posts

Wednesday, July 2, 2014

Sharing Wireless Internet To Ethernet

Sometimes we need to share our wireless internet to an ethernet connected clients or anything else such as wireless access points or network switches.

In my situation, my smartphone can not connect directly to my preferred primary wireless access point. So i need to setup a simple wireless repeater.

First is first, i need to connect to the primary wireless access point using my pc.

After that, i configure my pc as a client to relay the internet to my secondary access point which is tp-link wireless access point and it already has its own DHCP server. I dont need to configure any DHCP server then.

My wireless adapter on my pc connected to the primary wireless access point is wlan1. This is how i do it.

internet --> wlan1 (on my pc) --> ethernet (on my pc too) --> network cable --> tp-link wireless access point --> smartphone

For your info, i already configured my tp-link wireless access point to match my ethernet configurations (IPs, Subnets, gateways).

All i need to do after connecting to primary wireless access point is run this commands.

ip link set up dev eth0
ip addr add dev eth0 
sysctl net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
iptables -A FORWARD -i eth0 -o wlan1 -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT

take note that my ethernet is eth0.

Monday, June 30, 2014

Mobile Squalo Antenna

Squalo antenna is a deritative design from halo antenna. Half wave with gamma match provides good performance and compact design. Halo antenna originally a dipole with gamma tuning match using a variable capacitor bended to a circular design. Squalo follows halo but instead of being circular, it was designed to square. Suitable for mobile station and also fixed or portable station. 

9M2SE 2013 CQ WPX Certificate

Congratulations to all participated members. See you next event. 

Thursday, June 12, 2014

Eyeball QSO With 9M2FB

Last week was my last eyeball QSO with my friend OM Ian Buffham before he migrates to Thailand. He lived years and years here in Taman Tun Dr Ismail. Alone while his wife is in Thailand running a Thai restaurant.

I invited one of my fellow friend, mutalib 9m2sql to meet ian buffham in TTDI. 

OM Ian is one of my CW friends. We talked in morse code on 20m before and had our first eyeball QSO in Sungai Buloh. 

June 2014 will be his last month living here in Malaysia and after that he will be staying in Thailand with his family. 

In TTDI he had problems putting up the antenna. All he had done were only a wire dipole at his apartments balcony and the view is heading to pasific sea. 

I hope that he can build a perfect radio station on his new home later. Looking forward to work with him later and for sure with his new callsign too. 

Monday, June 9, 2014

Load Balancing On Linux Using Nexthop

How to get faster internet connection for your workstations ? basically the more bandwidth, the low latency, the faster internet you will get. But it depends on your networking devices too. Using a gigabits ethernet adapter while using 10/100 Megabits of networking switches wont make your packet goes through faster (vise-versa)

The theory to get faster internet is to have faster networking devices, from network adapter, cables or high speed wireless router and also a fiber internet.

Load balancing is a technique to distribute packets to multiple gateways. Aim to optimize our available resources and the most important is to maximize throughput. Using multiple connections with load balancing instead of a single connections may increase reliability through redundancy.

On Linux operating systems, route command has many options. One of them are nexthop option. The next hop, or gateway, is the address of the next station to which the packet is to be sent on the way to its final destination.

If you are using both cable and wireless, operating system such as Linux or Windows will choose which one has the lowest latency to the gateway. In this case, cable will be always the winner.

How to maximize your available resources ? The command is simple, when you are connected to both cable and wireless, just type ip route del default scope global ; ip route add default scope global nexthop via dev eth0 weight 1 nexthop via dev wlan0 weight 1 && ip r

ip route del default scope global - to remove the default gateway that operating system has already choose for you based on the latency to the gateway.

ip route add default scope global nexthop via dev eth0 weight 1 nexthop via dev wlan0 weight 1 - this command will define your gateways for your selected network adapters. You will need to readjust your gateway addresses depending on your networks configuration. In my case, my gateway for my cable connection is and my gateway for my wireless connection is Please notice that my wireless adapter name is wlan0.

ip r - this command will show your gateways. You will see the outputs. For example,

root@linux:~# ip r
nexthop via  dev eth0 weight 1
nexthop via  dev wlan0 weight 1

This script will do the magic job. When i connects to my wifi, it will automatically runs the load balancing script.



if [ "$IF" == "wlan0" ]
    case "$2" in
        ip route del default scope global ; ip route add default scope global nexthop via dev eth0 weight 1 nexthop via dev wlan0 weight 1

Put it on /etc/NetworkManager/dispatcher.d/ and name it as 90loadbalance.sh. This "90" in the name of the script means that this script will be executed in the last 10% of all scripts if you have a bunch of scripts to execute. Dont forget to make it executable. 

Watch this video and see the output of iptraf for my 2 network adapter which is eth0 and wlan0.

p/s - if you use desktop computer, you can install wifi usb adapter. You can try to install 3 or 5 network adapter (wifi, ethernet) to your desktop or laptop and readjust the command depending on your devices and gateways. Practically it will work, but i never tried. You also can make the script to run periodically, persistently by putting it to the crontab.

Related Posts Plugin for WordPress, Blogger...