В Tue, 07 Apr 2015 20:43:08 -0400 James Knott <james.knott@rogers.com> пишет:
On 04/07/2015 01:29 PM, Andrei Borzenkov wrote:
В Tue, 07 Apr 2015 07:51:49 -0400 James Knott <james.knott@rogers.com> пишет:
On 04/06/2015 11:53 PM, Andrei Borzenkov wrote:
Second one won't work. Gateway must be on locally attached network. It had always been this way. Not quite. However, the route to the gateway must be known. bor@opensuse:~> ip r l default via 192.168.1.1 dev wlan0 proto static metric 1024 192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.46 bor@opensuse:~> sudo ip route add 1.2.3.4/24 via 2.3.4.5 dev wlan0 RTNETLINK answers: Invalid argument
I'm curious how you create such route.
I'm not sure with IP, but this is from the "route" man page:
bor@opensuse:~> LC_ALL=C sudo route add -host 1.2.3.4 gw 2.3.4.5 SIOCADDRT: Network is unreachable
gw GW route packets via a gateway. NOTE: The specified gateway must be reachable first. This usually means that you have to set up a static route to the gateway beforehand. If you specify the address of one of your local interfaces, it will be used to decide about the interface to which the packets should be routed to. This is a BSDism compatibility hack."
And:
"route add default gw mango-gw adds a default route (which will be used if no other route matches). All packets using this route will be gatewayed through "mango-gw". The device which will actually be used for that route depends on how we can reach "mango-gw" - the static route to "mango-gw" will have to be set up before."
So, if the gateway was on another lan, you'd need a connection and route to it. Generally, it's on the local lan though. It's also possible to specify just an interface and not an IP address for the gateway.
Yes, interface-only routes are quite useful with point-to-point links to conserve address space.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org