Openbsd as gateway Problem

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33224
groups: lo inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6
rl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:1b:11:66:02:da media: Ethernet autoselect (100baseTX full-duplex)
status: active inet6 fe80::21b:11ff:fe66:2da%rl0 prefixlen 64 scopeid 0x1
inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255

rl1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:1b:11:5b:71:58 media: Ethernet autoselect (none) status: no carrier
inet 176.16.1.2 netmask 0xfff00000 broadcast 176.31.255.255
inet6 fe80::21b:11ff:fe5b:7158%rl1 prefixlen 64 scopeid 0x2

ral0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:1c:10:e4:eb:0e groups: wlan media: IEEE802.11 autoselect mode 11g hostap statuc: active
ieee802.11: nwid xxx chan 11 bssid: lladdr nwkey xxx 100dBm
inet 192.168.2.2 netmask 0xffffff00 broadcast 192.168.2.255
inet6 fe80::21c:10ff:fee4:eb0e%ral0 prefixlen 64 scopeid 0x3

pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33224
enco: flags=0<> mtu 1536
tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1492
groups: tun egress inet 60.48.182.211 --> 219.93.218.177 0xffffffff
I usign lynx text browser to post this. Sorry for any incovenience cause due to my pc has send to reapir.

I need to see the current state of play,

ifconfig -a

can you ping your router?

can you ping a device beyond your router?

$ ping www.unix.com
PING www.unix.com (81.17.242.186): 56 data bytes
64 bytes from 81.17.242.186: icmp_seq=0 ttl=41 time=415.7 ms
64 bytes from 81.17.242.186: icmp_seq=1 ttl=41 time=382.1 ms

I usign lynx text browser to post this. Sorry for any incovenience cause due to my pc has send to repair.

$ ping www.unix.com
PING www.unix.com (81.17.242.186): 56 data bytes
64 bytes from 81.17.242.186: icmp_seq=0 ttl=41 time=415.7 ms
64 bytes from 81.17.242.186: icmp_seq=1 ttl=41 time=382.1 ms

Network Structure :

Modem -> (rl0)Openbsd(rl1 ral0) -> desktop && laptop :

Bothe of the wired and wireless connection can get ip from openbsd router.

Wired Gateway ip is 176.16.1.1
Ping from desktop to openbsd : Result is request timeout.

Wireless Gateway is 192.168.2.1
Ping from desktop to openbsd : Result is request timeout also.

Wired Connection ip is 176.16.10.10
Ping from openbsd to desktop : Result is ok

Wireless Connection ip is 192.168.2.3
Ping from openbsd to laptop : Result is ok

Thanks for your hel.

Your help is greatly appreciated by me an others.

It feels like progress...

What is the state of play with the openbsd to internet on rl0? Can you ping the modem? Can you ping 81.17.242.186 (www.unix.com)?

Can you get name resolving working.

Remember we want to get the internet side of things all working first.

However, on the desktop and laptop do their netmasks and subnet addresses match the same as what the openbsd box thinks they should be?

What do the laptop and desktop claim their default routes are?

Have you enabled forwarding?

comp.unix.bsd.freebsd.misc: Re: FreeBSD Internet Gateway Router

Sorry to post some incorrect information.

I can ping and browse unix.com with the gateway openbsd.
I have test it the result is not ok for both wireless and wired as well.

I try to disable the pf also the same.

The address from desktop and laptop is as desired from openbsd.

Openbsd cannot ping client and client cannot ping openbsd.

Below is netstat -r | less :

Why this two interface doesn't have G in its flags ?

This appear that the gateway is down.

/etc/sysctl.conf net.inet.ip.forwading=1 but
net.inet6.ip6.forwading=0;

A billion thanks for your help.

Thanks.

I also confim it with sysctl -a |less

Below is a information :

net.inet.ip.forwading=1
net.inet.ip.redirect=1
net.inet.ip.sourcerate=0
net.ine6.ip.forwading=0

My guess is that the G is for the interface which has the default gateway on it's subnet.

So, to confirm IP routing....

confirm that laptop can ping openbsd.

confirm that desktop can ping openbsd

both have the appropriate openbsd addresses that live on their subnets as their default routes.

then try and ping the desktop from the laptop or vice versa.

BTW forwarding is mispelt in your postings.

Please confirm state of modem/router.

Laptop->OpenBSD option routers 192.168.2.1=cannot request timeout
Desktop->OpenBSD options routers 176.16.10.1=cannot request timeout
Ping modem(192.168.1.1) ok 1ms
Ping www.unix.com(ok) 300ms
I have to tell u honestly. Laptop <-> Desktop I have only one gateway and one laptop due to my desktop sent to repair. Perhaps i should go to my friends there to try it out. Does this very important ?
Do u came from europe cause ur reply time is almost same with me ?

Well we have got good comms to the internet from your openbsd box.

Now we want to ensure we have good connectivity to your laptop.

What state is it in? Both on same subnets, both with same netmasks and broadcast addresses, and the laptops default route should be the address of the openbsd box on this interface.

I not really understand what u say but i will post some information here in order to for us to solve this problem together.
/etc/hostname.rl1 : inet 176.16.1.2 255.240.0.0 NONE
/etc/hostname.ral0 : inet 192.168.2.2 255.255.255.0 NONE and some other options
/etc/dhcpd.conf:Wired: subnet 176.16.0.0 netmask 255.240.0.0 option routers 176.16.1.1; range 176.16.10.10 176.16.10.12;
Wireless: subnet 192.168.2.0 netmask 255.255.255.0 options routers 192.168.2.1; range 192.168.2.3 192.168.2.5;
Both laptop and desktop can get ip from openbsd 4.1. No ping openbsd <-> Laptop || Desktop.
Wired connection from desktop after get ip :
ip: 176.16.10; DHCP server: 176.16.1.2 DG:176.16.1.1
I ping 176.16.1.2 respond but 176.16.1.1 no respond.
A billion thanks for your help.

Merry Christmas to you all.

I have read an articles from techrepublic. This article mention that class C subnet which is 255.255.255.0. WHen routing, it cannot truncate it to class A or B because 24 bits is for the network address. This is stealing address. The last eight bits is for host address.
I don't know whether this is true. Therefore, i ask here.
rl0(External INterface) subnet by ISP is 255.255.255.0
rl1(INternal interface) subnet 255.240.0.0
ral0(Wireless interface) subnet 255.255.255.0
Thanks.

When you explicitly pass the address *and* netmask you are effectively dealing with class-less routing. The class only matters in the router or tools have to assume the netmask.

My internal net is 10.0.0.0/255.0.0.0, but I have that split into a number of 256 address subnets. The internet router is on 10.1.1.1/24 then I have static routes configured in the internet router for the other subnets to go via my internal netbsd gateway.

I not really understand what u mean but i can understand when ip addresss *and* with netmask.
How come i still cannot function properly with a correct settings ? can u check my configuration.

A billion thnaks for your help and merry christmas.

Dear Peter_APIIT,

I kindly suggest you should simplify your IP configuration.

First, your external gateway IP address and subnet mask is allocated by your ISP, so you can't change that (nor should you).

However, all your internal IP addresses our your 192.168 networks should have the same subnet mask.

I suggest you make them all 255.255.255.0 (/24) and keep it simple.

Are you willing to do this?

I willing to do so as lon as you all can provide me a solution.
Multiples interface cannot have same subnet mask. IS it true ? I have internal and wilress.
Thanks.

First, you need to correct your spelling if you are going to post here. Correct spelling is one of our rules. Why? So when people search using key words, they can actually get hits. Incorrectly spelled keywords to not match.

Second, you are incorrect in your understanding of subnet masks. There is no reason that muliple interfaces cannot have the same subnet mask.

For example, you should have your two internal interfaces as:

192.168.1.1 subnet mask 255.255.255.0 
192.168.2.1 subnet mask 255.255.255.0 

Notice that the subnet masks are the same, only the network address changes.

Maybe you should pause and go buy a book on TCP/IP and learn the basics?