DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 30th October 2021
erpete erpete is offline
Port Guard
 
Join Date: Jan 2019
Posts: 10
Default Rebooting router necessary?

I use OpenBSD as an experimental home router and there is a wifi external device attached to it as an access point. It works well so far. The only problem I have is when I switch off and on the wifi it has no access to internet then and I need to reboot the router. Wifi connects to router just fine but doesn't get connected to outer internet so I guess it's Packet Filter. Is there any way around it?
Reply With Quote
  #2   (View Single Post)  
Old 30th October 2021
fvgit's Avatar
fvgit fvgit is offline
Spikes in tights
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("U2hlcndvb2QgRm9yZXN0")'
Posts: 314
Default

Not sure if this helps, but you can restart your network without rebooting by running the netstart(8) script. It's what the system does when it boots.

See the manpage for further explanation. You can also perform a dry-run of netstart with the -n option. This will simply print all the commands netstart would run if invoked normally.
Reply With Quote
  #3   (View Single Post)  
Old 31st October 2021
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,132
Default

As a start you could run these commands when you rebooted your OBSD pf router and WiFi clients can access the internet:

Code:
# (ifconfig -A ; netstat -rn -f inet ; cat /etc/resolv.conf) >working_log.txt
Then switch off and turn on the WiFi access point without rebooting your router to make sure your WiFi clients cannot access the Internet.
Code:
# (ifconfig -A ; netstat -rn -f inet ; cat /etc/resolv.conf) >notworking_log.txt
Now compare the the output of these 2 files:
Code:
# diff -u working_log.txt notworking_log.txt
Alternatively you also can do a sdiff(1) on these files.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #4   (View Single Post)  
Old 31st October 2021
erpete erpete is offline
Port Guard
 
Join Date: Jan 2019
Posts: 10
Default

Thank you, fvgit. I tried the netstart script before and it did not help. Didn't know about the -n option, though.
Reply With Quote
  #5   (View Single Post)  
Old 31st October 2021
erpete erpete is offline
Port Guard
 
Join Date: Jan 2019
Posts: 10
Default

J65nko,

the relevant part (plus = notworking_log):

Code:
-192.168.2/24       192.168.2.1        UCn        3       18     -     4 ure1 
-192.168.2.1        d0:37:45:ec:fc:9d  UHLl       0       73     -     1 ure1 
-192.168.2.16       94:be:46:b6:24:a7  UHLc       1     1684     -     3 ure1 
-192.168.2.19       e4:c3:2a:65:c3:30  UHLc       0        3     -     3 ure1 
-192.168.2.20       e4:c3:2a:65:c3:30  UHLc       1       81     -     3 ure1 
+192.168.2/24       192.168.2.1        UCn        0        0     -     4 ure1 
+192.168.2.1        d0:37:45:ec:fc:9d  UHLl       0        0     -     1 ure1 
 192.168.2.255      192.168.2.1        UHb        0        0     -     1 ure1
Apparently, the wifi router and connected device (a tablet) are missing in the routing table. I just don't know why. The ifconfig and resolv.conf outputs are the same.
Reply With Quote
  #6   (View Single Post)  
Old 2nd November 2021
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,132
Default

I have a similar setup. An Alix 386 OpenBSD system with three NICs, one external, one for the internal wired Ethernet home LAN, and one for the WiFi router/access point.

On the Alix dhcpd has been configured to handle requests from both the internal wired LAN as well as from the WiFi clients. The following snippet is for the WiFi clients on the 10.7.7.0/24 NIC
Code:
     40 subnet 10.7.7.0  netmask 255.255.255.0 {
     41
     42         option routers 10.7.7.10;
     43         range 10.7.7.11  10.7.7.254;
     44
     45 }
Because the Alix does give out the adresses to the WiFi clients, it has no problems when the Wifi router/access point has been turned off/on.

Who gives out the addresses for your WiFi clients?Your WiFi router or your OpenBSD pf router?
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #7   (View Single Post)  
Old 2nd November 2021
erpete erpete is offline
Port Guard
 
Join Date: Jan 2019
Posts: 10
Default

In fact, there is subnet for LAN as well. The wifi part is:

Code:
subnet 192.168.2.0 netmask 255.255.255.0 {
        option domain-name-servers 192.168.2.1;
        option routers 192.168.2.1;
        range 192.168.2.10 192.168.2.254;
}
So OpenBSD router gives out the addresses. There is no such problem on LAN when connecting computers which is interesting.
Reply With Quote
  #8   (View Single Post)  
Old 3rd November 2021
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,132
Default

How is the WiFi access point connected to the OpenBSD pf router? How many NIC's does your OpenBSD pf box have? Three?
All three NICs should be on a different subnet.
What is the output of # ifconfig -A?
This is mine:
Code:
vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:0d:b9:2a:bf:e0
        priority: 0
        groups: egress
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
        inet 192.168.2.3 netmask 0xffffff00 broadcast 192.168.2.255
vr1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:0d:b9:2a:bf:e1
        priority: 0
        groups: internal
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
        inet 192.168.222.10 netmask 0xffffff00 broadcast 192.168.222.255
vr2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:0d:b9:2a:bf:e2
        priority: 0
        groups: internal
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
        inet 10.7.7.10 netmask 0xffffff00 broadcast 10.7.7.255
        inet 10.7.7.11 netmask 0xffffffff
  • vr0, the external interface is connected to my ISP router, and gets it IP from that router.
  • vr1is an internal interface connected to an ethernet switch for my wired LAN clients.
  • vr2is the second internal interface directly connected to my WiFi access point/router for the WiFi clients
As you can see they are all on different subnets.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #9   (View Single Post)  
Old 3rd November 2021
erpete erpete is offline
Port Guard
 
Join Date: Jan 2019
Posts: 10
Default

Wifi is connected to external NIC (ure1, 192.168.2). LAN is connected to external NIC (ure0, 192.168.1). All via cable.

Code:
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr 90:1b:0e:56:ba:6c
        index 1 priority 0 llprio 3
        groups: egress
        media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause)
        status: active
        inet 192.168.8.110 netmask 0xffffff00 broadcast 192.168.8.255
...
ure0: flags=8c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX,MULTICAST> mtu 1500
        lladdr 7c:c2:c6:1c:6b:86
        index 4 priority 0 llprio 3
        media: Ethernet autoselect (100baseTX full-duplex,rxpause,txpause)
        status: active
        inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
ure1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr d0:37:45:ec:fc:9d
        index 5 priority 0 llprio 3
        media: Ethernet autoselect (none)
        status: no carrier
        inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255
OBSD router is connected to ISP modem from internal NIC (re0) also via cable and receives IP address 192.168.8.110 from there (dhcp in hostname.re0). Very similar to your setup.

There are 2 subnets (1 and 2 see the IPs above) defined in "dhcpd.conf" (subnet 2 definition above, subnet 1 is basically the same, only printer is given fixed IP). "pf.conf" has the same setup for both subnets which is why I find this behavior strange.

Last edited by erpete; 3rd November 2021 at 05:54 PM.
Reply With Quote
Old 5th November 2021
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,132
Default

The ure1 ethernet adapter is an USB device. I wonder whether that could be the cause.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Old 5th November 2021
erpete erpete is offline
Port Guard
 
Join Date: Jan 2019
Posts: 10
Default

Quote:
Originally Posted by J65nko View Post
The ure1 ethernet adapter is an USB device. I wonder whether that could be the cause.
Yes, it is -- out of necessity. I'll try to swap ure1 and re0 and see if that helps. Thanks for the idea.
Reply With Quote
Old 7th November 2021
erpete erpete is offline
Port Guard
 
Join Date: Jan 2019
Posts: 10
Default

Connecting wifi router to internal NIC didn't help either.

Finally, upgrade to 7.0 seems to fix it.

Last edited by erpete; 7th November 2021 at 08:37 PM.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
home router + firewall behind ISP router beiroot OpenBSD General 24 3rd April 2017 08:40 PM
NAT router psypro OpenBSD General 18 27th October 2016 08:29 PM
DSL Router Zvrk NetBSD General 1 18th June 2009 01:21 PM
Good router terryd General software and network 10 9th February 2009 09:31 PM
D-link (DI-524) router c0mrade General software and network 3 26th January 2009 08:14 AM


All times are GMT. The time now is 01:34 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick