Re: Route Bad address or network unreacheable

2013-05-26 Thread Stuart Henderson
On 2013/05/26 12:52, Cesar Calvo wrote:
> Hi, thanks for sharing
> 
> >http://marc.info/?l=openbsd-misc&m=134643340822363
> >hostname.if:
> >   !route add -llinfo -iface -net 10.255.0.0/16 10.255.255.1 -ifp nfe0
> >   inet 1.2.3.4 255.255.255.255
> >   inet 1.2.4.3 255.255.255.255
> >   ...
> >
> >mygate:
> >   10.255.255.1
> 
> 
> I change all inet values for sanbox testing before apply settings in 
> production machine
> 
> 
> 
> 
> PF=no
> net.inet.ip.forwarding=1
> 
> My test ip is 10.1.1.1 in a usb wireless nic (urtwn0), and the gateway must 
> be 192.168.1.1 where is a linksys router/gateway

You do realise that having a gateway outside of your own subnet is a totally
broken setup normally only done by some "root server" operators to avoid
using an additional IP address? As well as needing special setup on their
customers machines they will most likely be doing something special on
their side of the network too which you'll also need to replicate if
you're trying to emulate this for a test...


> hostname.urtwn0:
> 
>   nwid wifi
>   wpakey 
>   inet 10.1.1.1 255.255.255.255
>   !route add -llinfo -iface -net 192.168.1.0/24 192.168.1.1 -ifp urtwn0
> 
> mygate:
> 192.168.1.1
> 
> 
> And the result is... Network is Unreachable and ping icmp packets are lost.
> 
> 
> urtwn0: flags=8843 mtu 1500
> lladdr f8:1a:67:18:16:eb
> priority: 4
> 
> groups: wlan egress
> media: IEEE802.11 autoselect (OFDM54 mode 11g)
> status: active
> ieee80211: nwid wifi chan 1 bssid 00:25:9c:2f:43:a0 198dB wpakey  displayed> wpaprotos wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp 
> wpagroupcipher tkip
> 
> inet 10.1.1.1 netmask 0xff00 broadcast 10.255.255.255
> 
> 
> 
> Thanks all for comments.
> 
> 
> 
> 2013/5/26 Stuart Henderson 
> 
> On 2013-05-25, Cesar Calvo  wrote:
> > Hi people.
> > I have a linux server a try to migrate to openbsd 5.3/amd64. I am
> totatly
> > new in this amazing OS.
> >
> > In linux I have:
> >
> >    - ip addr 200.124.200.125/32 dev net1
> >    - ip route add 190.64.x.x dev net1
> >    - ip route add default via 190.64.x.x
> >
> > All packets from net1 ip are delivery via 190.64.x.x gateway.
> > But on openbsd, route syntax is different.
> > I have hostname.em0 with:
> > inet 200.124.200.125 255.255.255.248 none
> > !route add 190.64.x.x -iface em0
> >
> > And in mygate I put only 190.64.x.x
> >
> > The result is bad address and network is unreachable.
> >
> >
> 
> See http://marc.info/?l=openbsd-misc&m=134643340822363 for an
> example
> of one way you might work around this broken network configuration.



Re: Route Bad address or network unreacheable

2013-05-26 Thread Cesar Calvo
Hi, thanks for sharing

>http://marc.info/?l=openbsd-misc&m=134643340822363
>hostname.if:
>   !route add -llinfo -iface -net 10.255.0.0/16 10.255.255.1 -ifp nfe0
>   inet 1.2.3.4 255.255.255.255
>   inet 1.2.4.3 255.255.255.255
>   ...
>
>mygate:
>   10.255.255.1

I change all inet values for sanbox testing before apply settings in
production machine


PF=no
net.inet.ip.forwarding=1

My test ip is 10.1.1.1 in a usb wireless nic (urtwn0), and the gateway
must be 192.168.1.1 where is a linksys router/gateway

hostname.urtwn0:
  nwid wifi
  wpakey 
  inet 10.1.1.1 255.255.255.255
  !route add -llinfo -iface -net 192.168.1.0/24 192.168.1.1 -ifp urtwn0

mygate:
192.168.1.1

And the result is... Network is Unreachable and ping icmp packets are lost.


urtwn0: flags=8843 mtu 1500
lladdr f8:1a:67:18:16:eb
priority: 4
groups: wlan egress
media: IEEE802.11 autoselect (OFDM54 mode 11g)
status: active
ieee80211: nwid wifi chan 1 bssid 00:25:9c:2f:43:a0 198dB
wpakey  wpaprotos wpa1,wpa2 wpaakms psk wpaciphers
tkip,ccmp wpagroupcipher tkip
inet 10.1.1.1 netmask 0xff00 broadcast 10.255.255.255


Thanks all for comments.



2013/5/26 Stuart Henderson 

> On 2013-05-25, Cesar Calvo  wrote:
> > Hi people.
> > I have a linux server a try to migrate to openbsd 5.3/amd64. I am totatly
> > new in this amazing OS.
> >
> > In linux I have:
> >
> >- ip addr 200.124.200.125/32 dev net1
> >- ip route add 190.64.x.x dev net1
> >- ip route add default via 190.64.x.x
> >
> > All packets from net1 ip are delivery via 190.64.x.x gateway.
> > But on openbsd, route syntax is different.
> > I have hostname.em0 with:
> > inet 200.124.200.125 255.255.255.248 none
> > !route add 190.64.x.x -iface em0
> >
> > And in mygate I put only 190.64.x.x
> >
> > The result is bad address and network is unreachable.
> >
> >
>
> See http://marc.info/?l=openbsd-misc&m=134643340822363 for an example
> of one way you might work around this broken network configuration.



Re: Route Bad address or network unreacheable

2013-05-26 Thread Stuart Henderson
On 2013-05-25, Cesar Calvo  wrote:
> Hi people.
> I have a linux server a try to migrate to openbsd 5.3/amd64. I am totatly
> new in this amazing OS.
>
> In linux I have:
>
>- ip addr 200.124.200.125/32 dev net1
>- ip route add 190.64.x.x dev net1
>- ip route add default via 190.64.x.x
>
> All packets from net1 ip are delivery via 190.64.x.x gateway.
> But on openbsd, route syntax is different.
> I have hostname.em0 with:
> inet 200.124.200.125 255.255.255.248 none
> !route add 190.64.x.x -iface em0
>
> And in mygate I put only 190.64.x.x
>
> The result is bad address and network is unreachable.
>
>

See http://marc.info/?l=openbsd-misc&m=134643340822363 for an example
of one way you might work around this broken network configuration.



Re: Route Bad address or network unreacheable

2013-05-25 Thread Alexey E. Suslikov
Cesar Calvo  urulab.com> writes:

> All packets from net1 ip are delivery via 190.64.x.x gateway.
> But on openbsd, route syntax is different.
> I have hostname.em0 with:
> inet 200.124.200.125 255.255.255.248 none
> !route add 190.64.x.x -iface em0

Above "route add" syntax seems strange to me. Man page says

route add -inet 192.168.5.0/24 192.168.0.1

Also, there is a -host modifier.

> And in mygate I put only 190.64.x.x
> 
> The result is bad address and network is unreachable.

You didn't show us neither ifconfig output, nor pf.conf
(which may be blocking something).

Haven't tried by myself, but setups with default gateway
being nexthop behind interface address may require
forwarding to be enabled (see /etc/sysctl.conf).