route problem

0 views
Skip to first unread message

Pol Hallen

unread,
May 20, 2013, 3:58:44 PM5/20/13
to FreeBSD Questions
Hi folks! On my lan I've:

server1

re0 - 192.168.1.250
xl0 - 192.168.2.250

default 192.168.1.212 UGS 0 189 re0
127.0.0.1 link#8 UH 0 18 lo0
192.168.1.0/24 link#1 U 0 6145 re0
192.168.1.250 link#1 UHS 0 0 lo0
192.168.2.0/24 link#7 U 0 2282 xl0
192.168.2.250 link#7 UHS 0 0 lo0

and gateway_enable="YES"

from server1 I can ping whole lan: 192.168.1.0/24, 192.168.2.0/24

from server2

re0 - 192.168.2.52

Destination Gateway Flags Refs Use Netif Expire
default 192.168.2.250 UGS 0 8450 fxp0
127.0.0.1 link#8 UH 0 0 lo0
192.168.2.52 link#6 UHS 0 0 lo0

I can ping 192.168.2.0/24 and ONLY 192.168.1.250.

I need ping 192.168.1.0/24 lan but I can only see 192.168.1.250

any idea?

thanks!

Pol
_______________________________________________
freebsd-...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questi...@freebsd.org"

Andre Goree

unread,
May 20, 2013, 4:07:50 PM5/20/13
to freebsd-...@freebsd.org
I'm pretty sure you need a route on "server2" to 192.168.1.0/24.

Try:

route add 192.168.1.0/24 192.168.2.250


--
Andre Goree
-=-=-=-=-=-
Email - an...@drenet.net
Website - http://blog.drenet.net
PGP key - http://www.drenet.net/0x83ADAAAB.asc
-=-=-=-=-=-

Pol Hallen

unread,
May 20, 2013, 4:19:18 PM5/20/13
to freebsd-...@freebsd.org
> Try:
> route add 192.168.1.0/24 192.168.2.250

does not run :-(

Pol

Andre Goree

unread,
May 20, 2013, 4:54:28 PM5/20/13
to freebsd-...@freebsd.org
On 2013-05-20 4:19 pm, Pol Hallen wrote:
> Try:
> route add 192.168.1.0/24 192.168.2.250
>
> does not run :-(
>
> Pol

Interesting. I had a similar issue I got around with a similar route
addition, though I was going from a LAN PC through my server that was
running openvpn out to a remotely connected client.

What was the error that the route command failed with? I could have the
syntax wrong (may need a "-net" in there), but I'm sure I used almost
the exact same thing to solve my issue -- in my case, I ran 'route add
10.0.1.0/24 10.0.0.98', where '10.0.1.0/24' is the openvpn client
network and '10.0.0.98' is the LAN interface of the openvpn server.

If you don't mind could you post the output of ifconfig from both boxes?

--
Andre Goree
-=-=-=-=-=-
Email - an...@drenet.net
Website - http://blog.drenet.net
PGP key - http://www.drenet.net/0x83ADAAAB.asc
-=-=-=-=-=-

Pol Hallen

unread,
May 20, 2013, 5:01:07 PM5/20/13
to freebsd-...@freebsd.org
> If you don't mind could you post the output of ifconfig from both boxes?

server1:

re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
ether 70:71:bc:94:c3:6d
inet 192.168.1.250 netmask 0xffffff00 broadcast 192.168.1.255
inet6 fe80::7271:bcff:fe94:c36d%re0 prefixlen 64 scopeid 0x1
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
xl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80008<VLAN_MTU,LINKSTATE>
ether 00:60:08:6d:59:50
inet 192.168.2.250 netmask 0xffffff00 broadcast 192.168.2.255
inet6 fe80::260:8ff:fe6d:5950%xl0 prefixlen 64 scopeid 0x7
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x8
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

server2

fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=2009<RXCSUM,VLAN_MTU,WOL_MAGIC>
ether 00:0f:fe:b3:db:8c
inet6 fe80::20f:feff:feb3:db8c%fxp0 prefixlen 64 scopeid 0x6
inet 192.168.2.52 netmask 0xffffff00 broadcast 192.168.2.255
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x8
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

Andre Goree

unread,
May 20, 2013, 7:27:40 PM5/20/13
to freebsd-...@freebsd.org
On 'server1', what is the output of 'sysctl net.inet.ip.forwarding'?
Perhaps you did not reboot after you set 'gateway_enable="YES"'?


This is from my box with forwarding enabled:
root@daemon ~ # sysctl net.inet.ip.forwarding
net.inet.ip.forwarding: 1
root@daemon ~ #


--
Andre Goree
-=-=-=-=-=-
Email - an...@drenet.net
Website - http://blog.drenet.net
PGP key - http://www.drenet.net/0x83ADAAAB.asc
-=-=-=-=-=-

Ivailo Tanusheff

unread,
May 21, 2013, 3:23:20 AM5/21/13
to Pol Hallen, FreeBSD Questions
Hi,

Hope you have rebooted after enabling the gateway, but you can check this with " sysctl net.inet.ip.forwarding " :)

So far from the server side it looks OK for me, but what are you pinging actually?
How is done the configuration of the target device?
This sounds like a pure routing problem, as you do not use NAT, then the devices in the 192.168.1.0/24 should know where to find your server.
The basic ideas are:
1. Make 192.168.1.250 default gateway for the devices in 192.168.1.0/24 or
2. route add -net 192.168.2 gw 192.168.1.250 (syntax depends on the OS)

Also check if the device you ping accepts pings - many devices denies this by default, also Windows 7/2008 and later has firewall enabled which do not permits pings.

Best regards,
Ivailo Tanusheff
Reply all
Reply to author
Forward
0 new messages