I want to switch primary network interface of my Ubuntu machine, I referenced this: http://www.cyberciti.biz/faq/linux-setup-default-gateway-with-route-command/.
Here is my setting for experiments: I use a router to provide connection for both wlan0 and eth0, with different IP (192.168.1.115 and 192.168.1.130 respectively, gateway 192.168.1.1). Normally eth0 is the default one, so I do:
route delete gw 192.168.1.1 eth0 route add gw 192.168.1.1 wlan0
Interestingly, although 192.168.1.115 is now the dominant IP, but I see incoming traffic captured in eth0 with 192.168.1.115 as destination IP, and outbound packet in wlan0 as expected.
Why this is happening? And what is the correct way to do that interface switching?