Ubuntu: Internet through WiFi, LAN through ethernet



Question:

How can I have my Ubuntu system simultaneously access the internet through its own WiFi adapter (not sharing) and have the wired ethernet connection be used to access the LAN? Where LAN means it's connected to the HTPC via crosover cable. Both function properly on their own, but whenever I activate the ethernet connection, I loose internet access.


Solution:1

You have to manually set default route or through Network Manager or via CLI.

The 2 network should have different subnet, i.e. wlan0 192.168.0.2/24 lan0 192.168.1.2/24

With CLI you can try removing the default lan0 gateway like this

route del default gw 192.168.1.1 dev eth0  

Then add the default gateway for wlan0

route add default gw 192.168.0.1 dev wlan0  

Remember to check the dns in /etc/resolv.conf

All commands should be run by root.

Sorry if too short but wrote from cell phone


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »