Force internet traffic through wifi
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I currently have a setup where my rpi 3b (raspbian jessie), is connected to two routers, using eth0 and wlan0. I want to using eth0 only to communicate with another device in tha LAN. And i want to use wlan0 for WAN traffic via the router.
- RPI eth0 -> router A -> Device in LAN. (RPI assigned IP in range 10.x.x.x)
- RPI wlan0 -> router B -> any WAN traffic. (RPI assigned static IP 192.168.1.13)
is it enough to use the route command, something like this below?
sudo route del default
sudo route add default gw 192.168.1.1 (let's say this is the IP address of the router i want to use for internet)
however i was advised to avoid using the route command, since it is overwritten by most network configuration commands.
debian networking raspberry-pi routing route
add a comment |Â
up vote
0
down vote
favorite
I currently have a setup where my rpi 3b (raspbian jessie), is connected to two routers, using eth0 and wlan0. I want to using eth0 only to communicate with another device in tha LAN. And i want to use wlan0 for WAN traffic via the router.
- RPI eth0 -> router A -> Device in LAN. (RPI assigned IP in range 10.x.x.x)
- RPI wlan0 -> router B -> any WAN traffic. (RPI assigned static IP 192.168.1.13)
is it enough to use the route command, something like this below?
sudo route del default
sudo route add default gw 192.168.1.1 (let's say this is the IP address of the router i want to use for internet)
however i was advised to avoid using the route command, since it is overwritten by most network configuration commands.
debian networking raspberry-pi routing route
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I currently have a setup where my rpi 3b (raspbian jessie), is connected to two routers, using eth0 and wlan0. I want to using eth0 only to communicate with another device in tha LAN. And i want to use wlan0 for WAN traffic via the router.
- RPI eth0 -> router A -> Device in LAN. (RPI assigned IP in range 10.x.x.x)
- RPI wlan0 -> router B -> any WAN traffic. (RPI assigned static IP 192.168.1.13)
is it enough to use the route command, something like this below?
sudo route del default
sudo route add default gw 192.168.1.1 (let's say this is the IP address of the router i want to use for internet)
however i was advised to avoid using the route command, since it is overwritten by most network configuration commands.
debian networking raspberry-pi routing route
I currently have a setup where my rpi 3b (raspbian jessie), is connected to two routers, using eth0 and wlan0. I want to using eth0 only to communicate with another device in tha LAN. And i want to use wlan0 for WAN traffic via the router.
- RPI eth0 -> router A -> Device in LAN. (RPI assigned IP in range 10.x.x.x)
- RPI wlan0 -> router B -> any WAN traffic. (RPI assigned static IP 192.168.1.13)
is it enough to use the route command, something like this below?
sudo route del default
sudo route add default gw 192.168.1.1 (let's say this is the IP address of the router i want to use for internet)
however i was advised to avoid using the route command, since it is overwritten by most network configuration commands.
debian networking raspberry-pi routing route
edited Jun 14 at 14:14
asked Jun 14 at 10:44
LecauseAndThePi
11
11
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
I'm not sure what you mean by route command being overwritten by config,
but you can use ip command instead (from iproute* package):
sudo ip route replace default via 192.168.1.1
sudo ip route flush cache
Both commands manage (view/edit) routing table entries.
A bit of advice - you can have the ethernet interface manually configured
without setting a default gateway on it (just an ip address and manual/dynamic
routing if necessary). If that's not an option you can configure dhcp client
to reject default gateway option on that interface (eth0).
Thank you for your answer. The issue with route, or ip route as you suggested, is that the changes do not seem to be permanent. If i reboot the device, or unplug and plug back the ethernet cable, all goes back as it was, with eth0 being the "preferred" interface and assigned with lowest metric. I am researching on the other 2 options you suggested. Thanks again
â LecauseAndThePi
Jun 14 at 13:03
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
I'm not sure what you mean by route command being overwritten by config,
but you can use ip command instead (from iproute* package):
sudo ip route replace default via 192.168.1.1
sudo ip route flush cache
Both commands manage (view/edit) routing table entries.
A bit of advice - you can have the ethernet interface manually configured
without setting a default gateway on it (just an ip address and manual/dynamic
routing if necessary). If that's not an option you can configure dhcp client
to reject default gateway option on that interface (eth0).
Thank you for your answer. The issue with route, or ip route as you suggested, is that the changes do not seem to be permanent. If i reboot the device, or unplug and plug back the ethernet cable, all goes back as it was, with eth0 being the "preferred" interface and assigned with lowest metric. I am researching on the other 2 options you suggested. Thanks again
â LecauseAndThePi
Jun 14 at 13:03
add a comment |Â
up vote
1
down vote
I'm not sure what you mean by route command being overwritten by config,
but you can use ip command instead (from iproute* package):
sudo ip route replace default via 192.168.1.1
sudo ip route flush cache
Both commands manage (view/edit) routing table entries.
A bit of advice - you can have the ethernet interface manually configured
without setting a default gateway on it (just an ip address and manual/dynamic
routing if necessary). If that's not an option you can configure dhcp client
to reject default gateway option on that interface (eth0).
Thank you for your answer. The issue with route, or ip route as you suggested, is that the changes do not seem to be permanent. If i reboot the device, or unplug and plug back the ethernet cable, all goes back as it was, with eth0 being the "preferred" interface and assigned with lowest metric. I am researching on the other 2 options you suggested. Thanks again
â LecauseAndThePi
Jun 14 at 13:03
add a comment |Â
up vote
1
down vote
up vote
1
down vote
I'm not sure what you mean by route command being overwritten by config,
but you can use ip command instead (from iproute* package):
sudo ip route replace default via 192.168.1.1
sudo ip route flush cache
Both commands manage (view/edit) routing table entries.
A bit of advice - you can have the ethernet interface manually configured
without setting a default gateway on it (just an ip address and manual/dynamic
routing if necessary). If that's not an option you can configure dhcp client
to reject default gateway option on that interface (eth0).
I'm not sure what you mean by route command being overwritten by config,
but you can use ip command instead (from iproute* package):
sudo ip route replace default via 192.168.1.1
sudo ip route flush cache
Both commands manage (view/edit) routing table entries.
A bit of advice - you can have the ethernet interface manually configured
without setting a default gateway on it (just an ip address and manual/dynamic
routing if necessary). If that's not an option you can configure dhcp client
to reject default gateway option on that interface (eth0).
answered Jun 14 at 12:05
jnbrains
111
111
Thank you for your answer. The issue with route, or ip route as you suggested, is that the changes do not seem to be permanent. If i reboot the device, or unplug and plug back the ethernet cable, all goes back as it was, with eth0 being the "preferred" interface and assigned with lowest metric. I am researching on the other 2 options you suggested. Thanks again
â LecauseAndThePi
Jun 14 at 13:03
add a comment |Â
Thank you for your answer. The issue with route, or ip route as you suggested, is that the changes do not seem to be permanent. If i reboot the device, or unplug and plug back the ethernet cable, all goes back as it was, with eth0 being the "preferred" interface and assigned with lowest metric. I am researching on the other 2 options you suggested. Thanks again
â LecauseAndThePi
Jun 14 at 13:03
Thank you for your answer. The issue with route, or ip route as you suggested, is that the changes do not seem to be permanent. If i reboot the device, or unplug and plug back the ethernet cable, all goes back as it was, with eth0 being the "preferred" interface and assigned with lowest metric. I am researching on the other 2 options you suggested. Thanks again
â LecauseAndThePi
Jun 14 at 13:03
Thank you for your answer. The issue with route, or ip route as you suggested, is that the changes do not seem to be permanent. If i reboot the device, or unplug and plug back the ethernet cable, all goes back as it was, with eth0 being the "preferred" interface and assigned with lowest metric. I am researching on the other 2 options you suggested. Thanks again
â LecauseAndThePi
Jun 14 at 13:03
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f449767%2fforce-internet-traffic-through-wifi%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password