Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 May 2001 14:28:51 +0300 (EEST)
From:      Iasen Kostoff <tbyte@tbyte.org>
To:        freebsd-net@freebsd.org
Subject:   routing socket and routes assignment
Message-ID:  <Pine.BSF.4.21.0105281342480.21037-100000@shadow.otel.net>

next in thread | raw e-mail | index | archive | help
Hi,
	I have a problem in assigning a default gateway from network that
my computer's interfaces don't have IP from. And even when I add a route
to this network throw any of the interfaces it still returns ENETUNREACH
message. Then I thought that I can fix that with -ifp modifer of route
command but - no luck. After many tryes I found a way to set this route
but I don't think it's the right way it should be done.
  Ok, now you have an interface with IP 2.2.2.2 but your gateway is
1.1.1.1 . First you should add a default route from your interface's
network or even his own IP 2.2.2.2 , then you should change this route
gateway to point to real gateway 1.1.1.1 and you should have a route to
this host or his network 1.1.1.1/??. Here is same but displayed with route
command:
1.	route add default 2.2.2.2
	
2.	route add 1.1.1.1 -iface xl0
	arp -s 1.1.1.1 lladdr_of_1.1.1.1
	or
	route add -net 1.1.1.1/24 -iface xl0
	
3.	route change default 1.1.1.1

4.	optionaly : route change default -ifp xl0
	
That did it but why can't I do it with this command:
	route add default 1.1.1.1 -ifp xl0

I look in sys/net/rtsock.c and sys/net/route.c and saw that
rtrequest() can't add a route to host throw interface but
route_output() function in rtsock.c could change it that way ?!?

I've changed these tow functions and now "route add default host -ifp
ifname" works but you still need a route to the gateway. 
	I think that if there is set ifp or ifa (end this is set if there
is a route at all :)) the kernel should try to arpresolve gateway's
lladdr throw that interface if it can't find a route to it.

Regards.



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0105281342480.21037-100000>