Re: Max Speed: configuration in smnpd.conf for display in mrtg

2019-08-25 Thread Daniel Ouellet
Thanks Stuart,

I guess I had the right oid before, but the fact that is doesn't allow
the replacement always give me a fail at restart, I assume I wasn't
using the right oid.

Oh well.

Doing the max speed in mrtg is possible, sure ,but as I have to many
routers that do change a lot as new customers are added or removed, it
was a lot simpler to do it in the actual router then trying to always go
back and over write the final configuration or mrtg each time.

Daniel


On 8/23/19 12:12 PM, Stuart Henderson wrote:
> On 2019-08-22, Daniel Ouellet  wrote:
>> Hi,
>>
>> Wonder if anyone would know the answer for this.
>>
>> I try to figure out what is the entry needed in the snmpd.conf for the
>> specific display that would show in mrtg when the scan is done.
>>
>> In short the display as
>>
>> Max Speed:   1000.0 Mbits/s
>>
>> to be display as for example
>>
>> Max Speed:   150.0 Mbits/s
>>
>> I have all other variable set properly for what's needed, but can't
>> figure this one out.
>>
>> IN Cisco router you can just do
>>
>> bandwidth 15
>>
>> for example to do this
>>
>> In smtpd.conf I can do
>>
>> system location "Your city location"
>>
>> But I haven't been able to figure what's the entry for the display of
>> the bandwidth itself oppose to the Interface speed.
>>
>> I thought this would do:
>>
>> system ifSpeed "150"
>>
>> but it doesn't and I really can't figure this one out.
>>
>> The man page does provide plenty but come short for this one.
>>
>> I process all the stats from an OpenBSD server and the router I query
>> are mostly Cisco but many are also OpenBSD too.
>>
>> Any clue stick?
>>
>> Many thanks
>>
>> Daniel
>>
>>
> 
> I think you need to just configure MaxBytes in mrtg config for the port.
> 
> Looking at snmpd.conf(5) and looking up the oid you might think of trying
> this,...
> 
> oid 1.3.6.1.2.1.2.2.1.5.$ifindex name ifSpeed read-only integer 123456
> 
> (replace $ifindex with the correct index for the port), but it doesn't
> actually work, snmpd doesn't allow overriding an existing oid in this way.
> 
> 



Re: [OpenIKED] Network traffic over VPN site-to-site tunnel stalls few times a day

2019-08-25 Thread Patrick Dohman
Radek
In my opinion upstream DNS & UDP issues can cause interrupts with some ISP's.
I also believe that defining specific proto's in your nat rule can decrease 
interrupts. 
You might consider the following to modification to your nat rule to 
specificity allow UDP & ICMP.

match out log on $ext_if inet proto { tcp, udp, icmp } rom { $lan_rac_local, 
$backup_local } nat-to $ext_if set prio (3, 7)

It appears that you have ICMP allow rules which is a good idea in my opinion.
Have you ever done any logging of these packets. Is there any legitimate 
requests from your ISP?
Do you have an alternate DNS server you can test against? Are you using your 
ISP’s DNS?
Perhaps the new OpenBSD unwind package is worth investigating ;)
]Regards
Patrick

> On Aug 25, 2019, at 1:31 PM, Radek  wrote:
> 
> Hello Patrick, 
> 
>> In my opinion your net5501’s system calls per interval are relatively high.
>> The (traps sys) column on my firewall hovers between 40 & 50 quite 
>> consistently.
>> My understanding is that system calls are things like program calls & 
>> library access.
> Is there any way to decrease these values?
> 
>> Many commercial routers run a customized kernel & rely on a striped down 
>> user-land.
>> The kernel is also recompiled to run TCP/IP4 only & can no longer execute 
>> things like storage or virtualization.
>> The OpenBSD O.S includes all the user-land tools such as ping & top in 
>> addition to a standardized precompiled kernel. 
> Ok, I get it.
> 
> 
> On Fri, 23 Aug 2019 21:12:35 -0500
> Patrick Dohman  wrote:
> 
>> In my opinion your net5501’s system calls per interval are relatively high.
>> The (traps sys) column on my firewall hovers between 40 & 50 quite 
>> consistently.
>> My understanding is that system calls are things like program calls & 
>> library access.
>> 
>> In addition your net5501’s memory requests per second seem heavy.
>> You have fifty eight million 1024 bucket requests per second.
>> My firewall has a max of one hundred thousand 128 bucket requests per second.
>> 
>> Many commercial routers run a customized kernel & rely on a striped down 
>> user-land.
>> The kernel is also recompiled to run TCP/IP4 only & can no longer execute 
>> things like storage or virtualization.
>> The OpenBSD O.S includes all the user-land tools such as ping & top in 
>> addition to a standardized precompiled kernel. 
>> Regards
>> Patrick
>> .
>>> 
>>> 
>>> On Thu, 22 Aug 2019 19:12:55 -0500
>>> Patrick Dohman  wrote:
>>> 
 Radek
 
 I’ve found that fast networking is actually CPU & memory intensive. 
 Pentium 4 and Xeon's are increasingly a necessity for stable firewalls in 
 my opinion.
 Keep in mind OpenBSD is a monolithic kernel & isn’t a one to one ratio 
 with a commercial router.
 
 What are your context switches & interrupts doing while the VPN is up & 
 traffic is flowing?
 
 vmstat -w 4
 
 What is your memory high water mark during a peak traffic?
 
 vmstat -m
 
 Regards
 Patrick
 
> On Aug 21, 2019, at 12:34 AM, radek  wrote:
> 
> Hello Patrick,
> I am sorry for the late reply.
> 
>> Do you consider memory an issue?
> No, I do not. I have a bunch of old Soekris/net5501-70 and ALIX2d2/2d3, 
> that I use for VPN testing.
> Current testing set (6.5/i386) is net5501-70 <-> ALIX2d3
> Production set (6.3/i386) is net5501-70 <-> ALIX2d2
> Also have tried net5501-70 <-> net5501-70 - the same VPN problem occurs
> It is unlikely that every box has any hardware issue.
> 
>> Unix load average can occasionally be deceiving.
> I did not know.
> 
>  net5501-70 
> $top -d1 | head -n 4
> load averages:  0.05,  0.01,  0.00RAC-fw65-test.PRAC 10:58:14
> 38 processes: 1 running, 35 idle, 1 dead, 1 on processor  up 3 days, 18:02
> CPU states:  0.5% user,  0.0% nice,  0.4% sys,  0.0% spin,  0.2% intr, 
> 98.8% idle
> Memory: Real: 18M/267M act/tot Free: 222M Cache: 97M Swap: 0K/256M
> 
>  ALIX2d3 
> $top -d1 | head -n 4
> load averages:  0.00,  0.00,  0.00mon65.home 07:30:05
> 37 processes: 1 running, 35 idle, 1 on processor  up 13:46
> CPU states:  0.3% user,  0.0% nice,  1.1% sys,  0.0% spin,  0.4% intr, 
> 98.3% idle
> Memory: Real: 125M/223M act/tot Free: 14M Cache: 47M Swap: 73M/256M
> 
> 
> 
>> What is the speed of your memory?
>> What make of Ethernets are you running?
> Dmesgs below
> 
>  net5501-70 
> OpenBSD 6.5 (GENERIC) #2: Tue Jul 23 23:08:46 CEST 2019
>  r...@syspatch-65-i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
> real mem  = 536363008 (511MB)
> avail mem = 511311872 (487MB)
> mpath0 at root
> scsibus0 at mpath0: 256 targets
> mainbus0 at root
> bios0 at mainbus0: date 20/80/26, BIOS32 rev. 0 @ 0xfac40
> pcibios0 at bios0: rev 2.0 @ 0xf/0x1
> pcibios0: pcibios_get_intr_r

Re: [OpenIKED] Network traffic over VPN site-to-site tunnel stalls few times a day

2019-08-25 Thread Radek
Hello Patrick, 

> In my opinion your net5501’s system calls per interval are relatively high.
> The (traps sys) column on my firewall hovers between 40 & 50 quite 
> consistently.
> My understanding is that system calls are things like program calls & library 
> access.
Is there any way to decrease these values?
 
> Many commercial routers run a customized kernel & rely on a striped down 
> user-land.
> The kernel is also recompiled to run TCP/IP4 only & can no longer execute 
> things like storage or virtualization.
> The OpenBSD O.S includes all the user-land tools such as ping & top in 
> addition to a standardized precompiled kernel. 
Ok, I get it.


On Fri, 23 Aug 2019 21:12:35 -0500
Patrick Dohman  wrote:

> In my opinion your net5501’s system calls per interval are relatively high.
> The (traps sys) column on my firewall hovers between 40 & 50 quite 
> consistently.
> My understanding is that system calls are things like program calls & library 
> access.
> 
> In addition your net5501’s memory requests per second seem heavy.
> You have fifty eight million 1024 bucket requests per second.
> My firewall has a max of one hundred thousand 128 bucket requests per second.
> 
> Many commercial routers run a customized kernel & rely on a striped down 
> user-land.
> The kernel is also recompiled to run TCP/IP4 only & can no longer execute 
> things like storage or virtualization.
> The OpenBSD O.S includes all the user-land tools such as ping & top in 
> addition to a standardized precompiled kernel. 
> Regards
> Patrick
> .
> > 
> > 
> > On Thu, 22 Aug 2019 19:12:55 -0500
> > Patrick Dohman  wrote:
> > 
> >> Radek
> >> 
> >> I’ve found that fast networking is actually CPU & memory intensive. 
> >> Pentium 4 and Xeon's are increasingly a necessity for stable firewalls in 
> >> my opinion.
> >> Keep in mind OpenBSD is a monolithic kernel & isn’t a one to one ratio 
> >> with a commercial router.
> >> 
> >> What are your context switches & interrupts doing while the VPN is up & 
> >> traffic is flowing?
> >> 
> >> vmstat -w 4
> >> 
> >> What is your memory high water mark during a peak traffic?
> >> 
> >> vmstat -m
> >> 
> >> Regards
> >> Patrick
> >> 
> >>> On Aug 21, 2019, at 12:34 AM, radek  wrote:
> >>> 
> >>> Hello Patrick,
> >>> I am sorry for the late reply.
> >>> 
>  Do you consider memory an issue?
> >>> No, I do not. I have a bunch of old Soekris/net5501-70 and ALIX2d2/2d3, 
> >>> that I use for VPN testing.
> >>> Current testing set (6.5/i386) is net5501-70 <-> ALIX2d3
> >>> Production set (6.3/i386) is net5501-70 <-> ALIX2d2
> >>> Also have tried net5501-70 <-> net5501-70 - the same VPN problem occurs
> >>> It is unlikely that every box has any hardware issue.
> >>> 
>  Unix load average can occasionally be deceiving.
> >>> I did not know.
> >>> 
> >>>  net5501-70 
> >>> $top -d1 | head -n 4
> >>> load averages:  0.05,  0.01,  0.00RAC-fw65-test.PRAC 10:58:14
> >>> 38 processes: 1 running, 35 idle, 1 dead, 1 on processor  up 3 days, 18:02
> >>> CPU states:  0.5% user,  0.0% nice,  0.4% sys,  0.0% spin,  0.2% intr, 
> >>> 98.8% idle
> >>> Memory: Real: 18M/267M act/tot Free: 222M Cache: 97M Swap: 0K/256M
> >>> 
> >>>  ALIX2d3 
> >>> $top -d1 | head -n 4
> >>> load averages:  0.00,  0.00,  0.00mon65.home 07:30:05
> >>> 37 processes: 1 running, 35 idle, 1 on processor  up 13:46
> >>> CPU states:  0.3% user,  0.0% nice,  1.1% sys,  0.0% spin,  0.4% intr, 
> >>> 98.3% idle
> >>> Memory: Real: 125M/223M act/tot Free: 14M Cache: 47M Swap: 73M/256M
> >>> 
> >>> 
> >>> 
>  What is the speed of your memory?
>  What make of Ethernets are you running?
> >>> Dmesgs below
> >>> 
> >>>  net5501-70 
> >>> OpenBSD 6.5 (GENERIC) #2: Tue Jul 23 23:08:46 CEST 2019
> >>>   r...@syspatch-65-i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
> >>> real mem  = 536363008 (511MB)
> >>> avail mem = 511311872 (487MB)
> >>> mpath0 at root
> >>> scsibus0 at mpath0: 256 targets
> >>> mainbus0 at root
> >>> bios0 at mainbus0: date 20/80/26, BIOS32 rev. 0 @ 0xfac40
> >>> pcibios0 at bios0: rev 2.0 @ 0xf/0x1
> >>> pcibios0: pcibios_get_intr_routing - function not supported
> >>> pcibios0: PCI IRQ Routing information unavailable.
> >>> pcibios0: PCI bus #0 is the last bus
> >>> bios0: ROM list: 0xc8000/0xa800
> >>> cpu0 at mainbus0: (uniprocessor)
> >>> cpu0: Geode(TM) Integrated Processor by AMD PCS ("AuthenticAMD" 
> >>> 586-class) 500 MHz, 05-0a-02
> >>> cpu0: FPU,DE,PSE,TSC,MSR,CX8,SEP,PGE,CMOV,CFLUSH,MMX,MMXX,3DNOW2,3DNOW
> >>> mtrr: K6-family MTRR support (2 registers)
> >>> amdmsr0 at mainbus0
> >>> pci0 at mainbus0 bus 0: configuration mode 1 (bios)
> >>> 0:20:0: io address conflict 0x6100/0x100
> >>> 0:20:0: io address conflict 0x6200/0x200
> >>> pchb0 at pci0 dev 1 function 0 "AMD Geode LX" rev 0x33
> >>> glxsb0 at pci0 dev 1 function 2 "AMD Geode LX Crypto" rev 0x00: RNG AES
> >>> vr0 at pci0 dev 6 function 0 "VIA VT6105M RhineIII" rev 0x96: irq 11, 
> >>> addr

Piping multiple lines of text via ssh

2019-08-25 Thread Mario Galindez
hello,

i have set my own app as the shell of a user on a remote host.  My app
reads from stdin, and prints output to stdout.

If I do:
ssh u...@remotehost.com

and manually type multiple lines of text,the app works as expected (i.e. it
processess each line, and outputs the result)

However, if I do this:

ssh -T u...@remotehost.com < file.txt

my tool only processes the first line, and then quits.

any clues?

thx, - m


Re :dhcrelay

2019-08-25 Thread shadrock uhuru
> To:
> shadrock uhuru 
> CC:
> misc@openbsd.org
>
>
> shadrock uhuru(niyal...@gmail.com) on 2019.08.23 18:46:32 +0100:
>> hi eveyone
>> if i have a dhcp server in subnet A connected to interface em0 (lan) and
>> subnet B connected to interface iwn0 (wireless zone) on the router
>> with dhcrelay -i em0 running on the router should the wireless subnet be
>> able?? to get its dhcp address from the dhcp server on the lan ?
> No, you would need to run 
>
>dhcrelay -i iwn0 
>
> to do that.
>
> Subject:
> Re: dhcrelay
> From:
> Sebastian Benoit 
> Date:
> 8/23/19, 10:12 PM
>
thank Sebastian
i have two samba  active domain controllers with dhcp installed on each,
is it possible to do this

dhcrelay -i iwn0  

or can only one dhcp server address be specified ?
shadrock


Re: Ergonomic USB wired mouse

2019-08-25 Thread Bruno Flueckiger
On 24.08., Anatoli wrote:
> Hi Bruno,
>
> AWESOME!! Thanks a lot! You can add "MX Vertical" to the list of the
> successfully tested pointing devices :D
>
> I just made some minor changes as this mouse only has 2 additional physical
> buttons (no secondary wheel, nor anything else). I removed the WAxis and
> lowered the button numbers on the ZAxis:
>
> Section "InputClass"
>     Identifier "Logitech MX Vertical"
>     MatchDriver "ws"
>     Driver "ws"
>     Option "Buttons" "16"
>     Option "Device" "/dev/wsmouse"
>     Option "Floating" "false"
>     Option "ZAxisMapping" "6 7"
> EndSection
>
> And adjusted xmodmap:
>
> xmodmap -e "pointer = 1 2 3 8 9 4 5 6 7 10 11 12 13 14 15 16"
>
> This way everything works as expected! Nice!
>

Thanks for reporting back your success. I like to read that my writing
is useful to others. The mapping of the axes to the different buttons
will vary for most devices. But if my article gave you what you needed
to get it running yourself my goal is reached.

>
> Some time ago I also saw your other great guide about extra keys on USB
> keyboards (https://www.bsdhowto.ch/extrakeys.html) and used some ideas from
> it. I'd like to suggest one thing though: not to run usbhidaction from rc
> (it could be started under regular users from their WM startup scripts) and
> not to put the actual commands in the usbhidaction config, but rather to
> call from there xdotool for each button with the key codes to generate (e.g.
> "xdotool key XF86Mail" XF86LaunchA-Z, XF86AudioPlay/Stop, etc.) and then to
> capture them with xbindkeys.
>

I do not use any X11 tools on purpose. It is my goal to describe a way
that works independently from X11.

> If you exec programs directly by usbhidaction the way you launch it, they'd
> be executed under root and some users reading your guide may not understand
> the implications. Also this way it's impossible for each user to customize
> the actions.
>

You're right about the security implications and the lack of multiuser
support in my article. From a security perspective it is better to run
usbhidaction as an unprivileged user. rc allows this by setting the user
parameter like this:

$ doas rcctl set user 

I've updated my article to include this setting. By the way it also
solves some trouble when you try to send commands to other media players
like moc (https://moc.daper.net/) which check for security.

The lack multi user support is left to the reader as an exercise :-)

> I tried to go even further and to detect the keyboard when it's attached
> with hotplugd & usbdevs/lsusb (for vendor/product IDs), but then I couldn't
> solve the link between uhidev & uhid instances
> (https://marc.info/?l=openbsd-misc&m=156499209423144&w=2). Please let me
> know if you have any idea how to solve this.
>
> Regards,
> Anatoli
>

I would try to grep the output of dmesg(8) for the uhids attached to the
uhidev. Something like that should give you a list of uhid belonging to
the uhidev that got just attached:

dmesg | grep "uhid. at uhidev4"

Cheers,
Bruno



Re: How do I publish default router preferences using rad?

2019-08-25 Thread Caleb Callaway
I want to enable a scenario similar to what's described in
https://tools.ietf.org/html/rfc4191#section-5.1

I run local network services for which I want a stable, publicly routed
prefix, but my ISP's delegated prefix isn't static. I've setup a
Hurricane Electric IPv6 tunnel to get a static prefix along side the
dynamic, ISP-delegated prefix; https://github.com/cqcallaw/openbsd-router
has details.

Everything is functionally correct with the source-based routing
configuration described in the docs, but the HE tunnel is necessarily
slow because of the overhead incurred by the 6in4 tunnel. Connections
are faster if my multihomed hosts prefer the native route for traffic
that doesn't require use of the tunnel.

I had patched rad to experiment with route preferences as a solution to
this performance issue, but my local hosts don't seem to honor the
advertised route preferences. I'm still researching what's required on
the client side for route preferences to be honored.

On Sun, Aug 18, 2019 at 4:28 AM Florian Obser  wrote:

> I'm curious, how are you using the router preference, could you tell
> us a bit more about your network topology?
> Also, what clients pay attention to it and how are they using it?
>
> Same goes for the route option, are you aware of clients using it?
>
> Thanks,
> Florian
>
> On Sat, Aug 17, 2019 at 08:09:54PM -0700, Caleb Callaway wrote:
> > If it interests anyone, I've also implemented the route option
> > described in https://tools.ietf.org/html/rfc4191#section-2.3
> >
> > I find sharing patches via this mailing list particularly unwieldy,
> > so I've pushed my work to a git branch at
> > https://github.com/cqcallaw/src/tree/rfc-4191
> >
> > On Wed, Aug 7, 2019 at 11:27 PM Caleb 
> wrote:
> > >
> > > Thank you for the code and review! I've synthesized the existing patch
> > > and review into something that successfully advertises router
> > > preferences in local testing (verified w/ rdisc6). This patch does not
> > > implement the route information option specified in RFC 4191 section
> > > 2.3.
> > >
> > > diff --git a/usr.sbin/rad/frontend.c b/usr.sbin/rad/frontend.c
> > > index 8178b058629..4031da6b99d 100644
> > > --- a/usr.sbin/rad/frontend.c
> > > +++ b/usr.sbin/rad/frontend.c
> > > @@ -411,7 +411,7 @@ frontend_dispatch_main(int fd, short event, void
> *bula)
> > > ra_prefix_conf))
> > >fatalx("%s: IMSG_RECONF_RA_PREFIX wrong "
> > > "length: %lu", __func__,
> > > -IMSG_DATA_SIZE(imsg));
> > > +IMSG_DATA_SIZE(imsg));
> > >if ((ra_prefix_conf = malloc(sizeof(struct
> > > ra_prefix_conf))) == NULL)
> > >fatal(NULL);
> > > @@ -1023,6 +1023,18 @@ build_packet(struct ra_iface *ra_iface)
> > >ra->nd_ra_router_lifetime =
> > > htons(ra_options_conf->router_lifetime);
> > >}
> > > +
> > > +   /* add router preference flags */
> > > +   if (ra_options_conf->preference == ND_RA_FLAG_RTPREF_RSV) {
> > > +   fatalx("Invalid router preference found during RA packet
> > > construction.");
> > > +   }
> > > +
> > > +   if (ra_options_conf->router_lifetime == 0) {
> > > +   log_debug("Router lifetime set to zero; ignoring router
> > > preference per https://tools.ietf.org/html/rfc4191#section-2.2";);
> > > +   } else {
> > > +   ra->nd_ra_flags_reserved |= ra_options_conf->preference;
> > > +   }
> > > +
> > >ra->nd_ra_reachable = htonl(ra_options_conf->reachable_time);
> > >ra->nd_ra_retransmit = htonl(ra_options_conf->retrans_timer);
> > >p += sizeof(*ra);
> > > diff --git a/usr.sbin/rad/parse.y b/usr.sbin/rad/parse.y
> > > index 004e5e22f92..74480148246 100644
> > > --- a/usr.sbin/rad/parse.y
> > > +++ b/usr.sbin/rad/parse.y
> > > @@ -32,6 +32,7 @@
> > > #include 
> > > #include 
> > > +#include 
> > > #include 
> > > #include 
> > > @@ -117,10 +118,12 @@ typedef struct {
> > > %token CONFIGURATION OTHER LIFETIME REACHABLE TIME RETRANS TIMER
> > > %token AUTO PREFIX VALID PREFERRED LIFETIME ONLINK AUTONOMOUS
> > > %token ADDRESS_CONFIGURATION DNS NAMESERVER SEARCH MTU
> > > +%token PREFERENCE LOW MEDIUM HIGH
> > > %token   STRING
> > > %token   NUMBER
> > > %typeyesno
> > > +%typepreference
> > > %typestring
> > > %%
> > > @@ -166,6 +169,11 @@ yesno  : YES   { $$ = 1; }
> > >| NO{ $$ = 0; }
> > >;
> > > +preference : LOW   { $$ = ND_RA_FLAG_RTPREF_LOW; }
> > > +   | MEDIUM { $$ = ND_RA_FLAG_RTPREF_MEDIUM; }
> > > +   | HIGH { $$ = ND_RA_FLAG_RTPREF_HIGH; }
> > > +   ;
> > > +
> > > varset : STRING '=' string {
> > >char *s = $1;
> > >if (cmd_opts & OPT_VERBOSE)
> > > @@ -213,6 +221,9 @@ ra_opt_block: DEFAULT ROUTER yesno {
> > >| MTU NUMBER {
> > >ra_options->mtu = $2;
> > >}
> > > +   | PREFERENCE preference {
> > > +   ra_options->preference = $2;
> > > +   }
> > >| DNS dns_block
> > >;
>

pppoe only connects if tcpdump is running?!

2019-08-25 Thread Mara Toni
Hello!

I got myself a new PCI ethernet card instead of an old USB3 to ethernet in a 
"router" named desktop machine.

in short:
But pppoe doesn't connects via the new PCI card. Only if I start a tcpdump on 
it!?


longer:
#
# THE CONFIG

router# cat /etc/hostname.re1
up lladdr xx:xx:xx:xx:xx:xx
router#
router# cat /etc/hostname.pppoe0
inet 0.0.0.0 255.255.255.255 NONE pppoedev re1 authproto pap debug authname 
'censored' authkey 'censored' up
dest 0.0.0.1
!/sbin/route add default -ifp pppoe0 0.0.0.1
router#

OpenBSD 6.5 amd64

#
# THE STATE

router# ifconfig re1
re1: flags=8843 mtu 1500
lladdr xx:xx:xx:xx:xx:xx
index 2 priority 0 llprio 3
media: Ethernet 100baseTX full-duplex
status: active
router#
router# ifconfig pppoe0
pppoe0: flags=8855 mtu 1492
index 5 priority 0 llprio 3
dev: re1 state: PADI sent
sid: 0x0 PADI retries: 5 PADR retries: 0
sppp: phase establish authproto pap authname "censored"
groups: pppoe egress
status: no carrier
inet 0.0.0.0 --> 0.0.0.1 netmask 0x
router#

router# dmesg|grep re1
re1 at pci3 dev 0 function 0 "Realtek 8168" rev 0x07: RTL8168E/8111E-VL 
(0x2c80), msi, address xx:xx:xx:xx:xx:xx
rgephy1 at re1 phy 7: RTL8169S/8110S/8211 PHY, rev. 5
router#

#
# I TRIED:

- rebooting, waiting for many minutes
- pap or chap
- mac filtering is OK, that is the MAC, what is in the hostname.re1
- doing: ifconfig re1 media "10baseT" - thinking of cable issue
- tried to plug in to the pci eth card via a Gbit switch, still no pppoe
- "ifconfig pppoe0 down" and "up" gives only these debug messages:

down:
Aug 24 15:15:06 router /bsd: pppoe0: lcp close(starting)
Aug 24 15:15:06 router /bsd: pppoe0: lcp starting->initial
Aug 24 15:15:06 router /bsd: pppoe0: phase dead

up:
Aug 24 15:15:11 router /bsd: pppoe0: lcp close(initial)
Aug 24 15:15:11 router /bsd: pppoe0: lcp open(initial)
Aug 24 15:15:11 router /bsd: pppoe0: lcp initial->starting
Aug 24 15:15:11 router /bsd: pppoe0: phase establish
Aug 24 15:15:11 router /bsd: pppoe0 (8863) state=1, session=0x0 output -> 
ff:ff:ff:ff:ff:ff, len=18

#
# INTERESTING THING:

if I plug back my old USB3 to ethernet, it works instantly (via the usb3 eth):

router# mv /etc/hostname.re1 /etc/hostname.cdce0
router# sed -i 's/re1/cdce0/g' /etc/hostname.pppoe0
+puting the ISP cable to cdce0.
then "reboot"
it works... gets IP:

router# ifconfig cdce0
cdce0: flags=8843 mtu 1500
lladdr xx:xx:xx:xx:xx:xx
index 5 priority 0 llprio 3
router#
router# ifconfig pppoe0
pppoe0: flags=8855 mtu 1492
index 6 priority 0 llprio 3
dev: cdce0 state: session
sid: 0x5eb PADI retries: 0 PADR retries: 0 time: 00:00:20
sppp: phase network authproto pap authname "censored"
groups: pppoe egress
status: active
inet yy.yy.yyy.yyy --> 10.0.0.1 netmask 0x
router#

#

a funny thing happened. I wanted to do a tcpdump on the pci ethernet re1, and 
during tcpdump, pppoe connected:

router# tcpdump -i re1
...
pppoe0: flags=8855 mtu 1492
index 6 priority 0 llprio 3
dev: re1 state: session
sid: 0x16f4 PADI retries: 9 PADR retries: 0 time: 00:01:24
sppp: phase network authproto pap authname "censored"
groups: pppoe egress
status: active
inet yy.yy.yy.yyy --> 10.0.0.1 netmask 0x

So it ONLY successfully connects via pppoe if tcpdump is running for re1! Why?

I can 100% reproduce it. If I stop the tcpdump, the public IP stays, but there 
is no internet connection to the world.

is this a bug? or a flag is set by tcpdump for the nic?

#

What am I missing? Why can't I connect via pppoe with the PCI ethernet card 
without running tcpdump on it?

Thanks.



Re: USB camera has "no usable YUV encodings"

2019-08-25 Thread Jan Stary
> On Aug 23 15:56:00, s...@spacehopper.org wrote:
> > > so is it some format based on a sequence of jpges?
> > MJPEG? that's possible.

> > Try some of these:
> > mplayer tv:// 
> 
> Works, looks like video(1), but full-screen
> (which is how my mplayer is configured).
> 
> $ mplayer -tv device=/dev/video1 tv://
> MPlayer SVN-r38138 (C) 2000-2019 MPlayer Team
> 
> Playing tv://.
> TV file format detected.
> Selected driver: v4l2
>  name: Video 4 Linux 2 input
>  author: Martin Olschewski 
>  comment: first try, more to come ;-)
> v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM 
> was used instead.
> Selected device: MikrOkularHD
>  Capabilities:video capture  read/write  streaming
>  supported norms:
>  inputs: 0 = Camera Terminal;
>  Current input: 0
>  Current format: MJPEG
> v4l2: ioctl set format failed: Invalid argument
> v4l2: ioctl set mute failed: Invalid argument
> v4l2: 0 frames successfully processed, 0 frames dropped.
> 
> It does not play, but it recognizes the device
> and apparently, it is a MJPEG stream. Thanks.

Hm, now the same command does play,
and there is yeast on my monitor. Thanks.

mplayer auto-recognizes the mjpeg format,
but reports a lot of frame-decoding errors (see below).

Jan


hans@dell:~$  mplayer -tv device=/dev/video1 tv://
MPlayer SVN-r38138 (C) 2000-2019 MPlayer Team

Playing tv://.
TV file format detected.
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski 
 comment: first try, more to come ;-)
v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was 
used instead.
Selected device: MikrOkularHD
 Capabilities:  video capture  read/write  streaming
 supported norms:
 inputs: 0 = Camera Terminal;
 Current input: 0
 Current format: MJPEG
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
v4l2: ioctl enum norm failed: Inappropriate ioctl for device
Error: Cannot set norm!
Selected input hasn't got a tuner!
v4l2: ioctl set mute failed: Invalid argument
==
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 58.54.100 (external)
Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG)
==
Audio: no sound
Starting playback...
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ig