Soren Harward via plug on 12 Jan 2023 07:38:09 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Multi-Interface Networking a PiDP8 Simulator


On Thu, Jan 12, 2023 at 8:39 AM Casey Bralla (Mail List) via plug
<plug@lists.phillylinux.org> wrote:
> But will this work?  Wouldn't the system try to send the telnet/ssh via the wireless as the default route?

Unless you've messed around with the route metrics, Linux will try to
send packets through any more specific route before it sends them
through the default route. So if you have

# ip route list
default via 10.1.1.1 dev eno1 proto static
10.1.1.0/24 dev eno1 proto kernel scope link src 10.1.1.10
10.1.2.0/24 dev eno2 proto kernel scope link src 10.1.2.10

and you ping 10.1.2.20, Linux will send that packet out eno2 via the
10.1.2.0/24 route instead of the default route on eno1.

You should be able to accomplish what you want using different
hostnames and/or domains for the hardwired addresses:

192.168.1.1 pidp8.wifi.home.arpa
192.168.2.1 pidp8.hardwired.home.arpa
192.168.1.2 eeepc.wifi.home.arpa
192.168.2.2 eeepc.hardwired.home.arpa

obvs replace the IPs with the ones that you're actually using. Then do
"ssh pidp8.wifi" when you're at home, and "ssh pidp8.hardwired" when
you're on the road.

-- 
Soren Harward
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug