Hello misc@, I have a OpenBSD-based router. Its configuration:
rl0 is connected to internal network in my flat rl1 is connected to home network (several flats) - some local servers are located in that network rl2 is connected with ADSL-modem - Internet access ath0 is wifi - wireless AP in my flat Detailed configuration (ifconfig && /etc/hostname.*) will be below. Till some time everything seems to work pretty fine. This week I have noticed that my Internet connection sometimes disappears. route show -inetshows that there is no default route (but it is added during the initialization of pppoe). sh -x /etc/netstart pppoe0 does not help - error message says route: writing to routing socket: Network is unreachable add net default: gateway 0.0.0.1: Network is unreachable Restart quickly fixes the problem. Other solution is to add manually default route. E.g. in case I have IP 78.37.32.133 and connected to Internet via 78.36.32.1, then command route add default 78.36.32.1 fixes the problem for a long time. BTW, ping to 78.36.32.1 passes normally in any case (even if the default route is not set). Well, any ideas what could be the problem? Of course I can write a simple script which will get this IP (ifconfig pppoe0 | sed ...) and then sets the desired default route. But I think this is not a correct behaviour, so I would like to fix that in a right was. Detailed configuration below. # ifconfig lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33204 groups: lo inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6 ath0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 00:1e:58:ad:74:d3 groups: wlan media: IEEE802.11 autoselect hostap status: active ieee80211: nwid homenet chan 1 bssid 00:1e:58:ad:74:d3 nwkey <not displayed> inet 192.168.2.254 netmask 0xffffff00 broadcast 192.168.2.255 inet6 fe80::21e:58ff:fead:74d3%ath0 prefixlen 64 scopeid 0x1 rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 00:e0:4c:e9:c5:dc media: Ethernet autoselect (100baseTX full-duplex) status: active inet 192.168.1.254 netmask 0xffffff00 broadcast 192.168.1.255 inet6 fe80::2e0:4cff:fee9:c5dc%rl0 prefixlen 64 scopeid 0x2 rl1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 00:11:6b:3f:16:02 media: Ethernet autoselect (100baseTX full-duplex) status: active inet6 fe80::211:6bff:fe3f:1602%rl1 prefixlen 64 scopeid 0x3 inet 10.0.155.43 netmask 0xffffff00 broadcast 10.0.155.255 rl2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 00:11:6b:96:70:48 media: Ethernet autoselect (100baseTX full-duplex) status: active inet6 fe80::211:6bff:fe96:7048%rl2 prefixlen 64 scopeid 0x4 enc0: flags=0<> mtu 1536 pppoe0: flags=8851<UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST> mtu 1492 dev: rl2 state: session sid: 0x1acf PADI retries: 5 PADR retries: 0 time: 00:25:07 sppp: phase network authproto pap groups: pppoe egress inet6 fe80::21e:58ff:fead:74d3%pppoe0 -> prefixlen 64 scopeid 0x7 inet 78.37.32.133 --> 78.36.32.1 netmask 0xffffffff pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33204 groups: pflog # cat /etc/hostname.ath0 inet 192.168.2.254 255.255.255.0 NONE media autoselect \ mediaopt hostap nwid "homenet" nwkey "*****" # cat /etc/hostname.rl0 inet 192.168.1.254 255.255.255.0 NONE # cat /etc/hostname.rl1 dhcp NONE NONE NONE !/sbin/route add 10.0.1/24 10.0.155.254 !/sbin/route add 10.0.10/24 10.0.155.254 !/sbin/route add 10.0.11/24 10.0.155.254 # cat /etc/hostname.rl2 up # cat /etc/hostname.pppoe0 inet 0.0.0.0 255.255.255.255 0.0.0.1 pppoedev rl2 \ authproto pap authname szt authkey szt up !/sbin/route add default 0.0.0.1 # cat /etc/pf.conf cl_if="rl1" adsl_if="pppoe0" int_if="rl0" wifi_if="ath0" nets_priv = "{ 127.0.0.0/8 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8 }" set block-policy drop set loginterface $adsl_if scrub out on $adsl_if all max-mss 1400 nat on $adsl_if from $int_if:network to any -> ($adsl_if) # dmesg pckbcintr: no dev for slot 1 syncing disks... done rebooting... OpenBSD 4.4 (GENERIC) #1021: Tue Aug 12 17:16:55 MDT 2008 dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC cpu0: Intel Pentium III ("GenuineIntel" 686-class, 128KB L2 cache) 698 MHz cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36, MMX,FXSR,SSE real mem = 267874304 (255MB) avail mem = 250580992 (238MB) mainbus0 at root bios0 at mainbus0: AT/286+ BIOS, date 07/20/01, BIOS32 rev. 0 @ 0xfdaf0, SMBIOS rev. 2.3 @ 0xf0600 (25 entries) bios0: vendor American Megatrends Inc. version "062710" date 07/15/97 bios0: American Megatrends Inc. Uknown acpi0 at bios0: rev 0 acpi0: tables DSDT FACP acpi0: wakeup devices ICH_(S4) PS2K(S1) UAR1(S1) USB_(S1) SLPB(S4) acpitimer0 at acpi0: 3579545 Hz, 24 bits acpiprt0 at acpi0: bus 0 (PCI0) acpiprt1 at acpi0: bus 2 (ICH_) acpicpu0 at acpi0: C3, C2 acpibtn0 at acpi0: SLPB bios0: ROM list: 0xc0000/0x10000 cpu0 at mainbus0 pci0 at mainbus0 bus 0: configuration mode 1 (no bios) pchb0 at pci0 dev 0 function 0 "Intel 82815 Host" rev 0x04 ppb0 at pci0 dev 1 function 0 "Intel 82815 AGP" rev 0x04 pci1 at ppb0 bus 1 vga1 at pci1 dev 0 function 0 "NVIDIA Vanta" rev 0x15 wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation) wsdisplay0: screen 1-5 added (80x25, vt100 emulation) agp0 at vga1: aperture at 0xe8000000, size 0x2400000 drm at vga1 unsupported ppb1 at pci0 dev 30 function 0 "Intel 82801AA Hub-to-PCI" rev 0x02 pci2 at ppb1 bus 2 ath0 at pci2 dev 10 function 0 "Atheros AR5212" rev 0x01: irq 9 ath0: AR2414 7.9 phy 4.5 rf2413 5.6, ETSI4W, address 00:1e:58:ad:74:d3 rl0 at pci2 dev 11 function 0 "Realtek 8139" rev 0x10: irq 11, address 00:e0:4c:e9:c5:dc rlphy0 at rl0 phy 0: RTL internal PHY rl1 at pci2 dev 13 function 0 "Realtek 8139" rev 0x10: irq 12, address 00:11:6b:3f:16:02 rlphy1 at rl1 phy 0: RTL internal PHY rl2 at pci2 dev 15 function 0 "Realtek 8139" rev 0x10: irq 10, address 00:11:6b:96:70:48 rlphy2 at rl2 phy 0: RTL internal PHY ichpcib0 at pci0 dev 31 function 0 "Intel 82801AA LPC" rev 0x02 pciide0 at pci0 dev 31 function 1 "Intel 82801AA IDE" rev 0x02: DMA, channel 0 wired to compatibility, channel 1 wired to compatibility wd0 at pciide0 channel 0 drive 0: <ST360021A> wd0: 16-sector PIO, LBA, 57241MB, 117231408 sectors wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 4 atapiscsi0 at pciide0 channel 1 drive 0 scsibus0 at atapiscsi0: 2 targets, initiator 7 cd0 at scsibus0 targ 0 lun 0: <ATAPI-CD, ROM-DRIVE-52MAX, 52CA> ATAPI 5/cdrom removable cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2 uhci0 at pci0 dev 31 function 2 "Intel 82801AA USB" rev 0x02: irq 10 ichiic0 at pci0 dev 31 function 3 "Intel 82801AA SMBus" rev 0x02: irq 11 iic0 at ichiic0 spdmem0 at iic0 addr 0x51: 256MB SDRAM non-parity PC133CL3 auich0 at pci0 dev 31 function 5 "Intel 82801AA AC97" rev 0x02: irq 11, ICH AC97 ac97: codec id 0x41445360 (Analog Devices AD1885) ac97: codec features headphone, Analog Devices Phat Stereo audio0 at auich0 isa0 at ichpcib0 isadma0 at isa0 com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo pckbc0 at isa0 port 0x60/5 pckbd0 at pckbc0 (kbd slot) pckbc0: using irq 1 for kbd slot wskbd0 at pckbd0: console keyboard, using wsdisplay0 pcppi0 at isa0 port 0x61 midi0 at pcppi0: <PC speaker> spkr0 at pcppi0 lpt0 at isa0 port 0x378/4 irq 7 it0 at isa0 port 0x2e/2: IT8712F rev 0x04, EC port 0x290 npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16 fdc0 at isa0 port 0x3f0/6 irq 6 drq 2 fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec usb0 at uhci0: USB revision 1.0 uhub0 at usb0 "Intel UHCI root hub" rev 1.00/1.00 addr 1 biomask ed65 netmask ff65 ttymask ffff mtrr: Pentium Pro MTRR support softraid0 at root root on wd0a swap on wd0b dump on wd0b -- BR, Sergey Khentov