Re: How to configure the networking on FreeBSD to assign the same IP between host and guest in order to make work CloudFlare Warp on FreeBSD

2024-05-05 Thread Mario Marietto
 This is what I did :

on FreeBSD :

/etc/rc.conf :

ifconfig_em0="inet 192.168.1.5 netmask 255.255.255.0"
defaultrouter="192.168.1.10"

On Ubuntu :

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A PREROUTING -t nat -p tcp -d 192.168.1.10 -j DNAT
--to-destination 192.168.1.5
iptables -A POSTROUTING -t nat -o enp0s13 -j MASQUERADE
warp-cli connect

What's the problem ? I'm able to connect to Ubuntu,but on FreeBSD I can't
surf.

On Sat, May 4, 2024 at 9:29 PM Mario Marietto 
wrote:

> So. Please help me further...
>
> Let's say that the IP number assigned to Ubuntu is 192.168.1.9,on FreeBSD
> I do :
>
> /etc/rc.conf :
>
> defaultrouter="192.168.1.9"
>
> ? even if the VM starts after the booting of FreeBSD ?
>
> About configuring the DNAT iptables rule I have no idea. Please help me to
> understand how to do it.
>
> On Sat, May 4, 2024 at 9:22 PM Apoorv Sachan 
> wrote:
>
>> Hi Mario
>>
>> You can set the ip if the Ubuntu machine as the default route on the
>> freeBSD host.
>> This will take all the traffic oroginating in freeBSD host through the
>> warp-tunnel.
>>
>> And configure a DNAT iptables rule in the Ubuntu machine to return the
>> traffic back to freeBSD machine.
>>
>> This way you could utilise the warp-cloud flare tunnel from the freeBSD
>> host even though it runs on the Ubuntu guest. And both have different IPs.
>>
>> On Sun, 5 May 2024 at 12:23 AM, Mario Marietto 
>> wrote:
>>
>>> Hello.
>>>
>>> I've just installed the CloudFlare client + GUI on Ubuntu,that I have
>>> virtualized with bhyve. Cloudflare does not work on FreeBSD. The
>>> instructions that I have followed are located here :
>>>
>>> https://youtu.be/4JuOUjCSj44
>>>
>>> Installing it in this way,it will run only on the IP assigned to Ubuntu
>>> inside the VM. For me the IP of FreeBSD is different from the IP assigned
>>> to Ubuntu. Configured in this way it's not useful.
>>>
>>> I want Cloudflare to take the IP address of FreeBSD.
>>>
>>> To achieve this goal,I should change my network configuration,in a way
>>> that I use the same IP for FreeBSD and Ubuntu.
>>>
>>> That's what I want to do,but I don't know how to do it. But I'm sure
>>> that I will be able to do it if someone can give me some advice.
>>>
>>> I can explain how I have configured my network,so you can explain what I
>>> should change to have the same IP.
>>>
>>> For example,to boot Ubuntu with bhyve,I use the following parameter :
>>>
>>> -s 13,virtio-net,tap19 \
>>>
>>>
>>> /etc/rc.conf :
>>>
>>> ifconfig_em0="DHCP"
>>> local_unbound_enable="YES"
>>> cloned_interfaces="bridge0 tap0 tap1 tap2 tap3 tap4 tap5 tap6 tap7 tap8 
>>> tap9 tap10 tap11 tap12 tap13 tap14 tap15 tap16 tap17 tap18 tap19 tap20 em0"
>>> ifconfig_bridge0="addm em0 addm tap0 addm tap1 addm tap2 addm tap3 addm 
>>> tap4 addm tap5 addm tap6 addm tap7 addm tap8 addm tap9 addm tap10 addm 
>>> tap11 addm tap12 addm tap13 addm tap14 addm tap15 addm tap16 addm tap17 
>>> addm tap18 addm tap19 addm tap20"
>>>
>>>
>>> /boot/loader.conf
>>>
>>> if_tap_load="YES"
>>> if_bridge_load="YES"
>>> bridgestp_load="YES"
>>>
>>>
>>> /etc/sysctl.conf
>>>
>>> net.link.tap.up_on_open=1
>>> net.inet.ip.forwarding=1
>>> net.inet.ip.random_id=1
>>>
>>>
>>> So,ok. I think you have understood what I want to do. Please help me.
>>> Thanks.
>>>
>>> --
>>> Mario
>>>
>>
>
> --
> Mario.
>


-- 
Mario.


Re: review request: changing the default ifconfig(8) address format to CIDR

2024-05-05 Thread Warner Losh
I'll remind everybody that ifconfig has had IFCONFIG_FORMAT since
```
commit 7c2aa744374aa3449ad81f60852e74ad73d823e6
Author: Allan Jude 
Date:   Tue May 31 17:30:08 2016 +

ifconfig(8) now supports some output formatting options
```
so we've already 7 years into this process. This is nothing new and the
desire to migrate has been around a long time. As such, we can transition
in 15, and put a release note into 14.1 release that's coming up and still
give people years worth of notice. We don't need to give 4 or 5 years
notice to do this in 16. That's too long and people will take their eye off
the ball and it will be 17 or 18 before it happens. I've had several things
I "gratuitously" had a long horizon on, only to forget about until it was
too late (14.0 was supposed to have an awk that didn't decode hex number,
for example).

Also, broken scripts are a 1 line fix away from working, so the impact is
rather small, and that one line can be set globally for people that have a
lot of these scripts. The fix can be placed into the release notes as well.
In addition, there's plenty of time for us to get a feel on how many
scripts there actually are here. We can back off to a longer time horizon
if it proves to be too disruptive. It would be even better if ifconfig, or
a similar tool, could produce easy to use in scripts data (like json via
libxo). I'm surprised there's no libxo option to it today. Of course these
would be a more intrusive change, but would insulate us from data change
like we've done in nearly every other system. I don't support more weird
options, though, to make the current formats more maillable. We need to
start pushing people into scripting with useful data formats. That includes
doing stragglers like nvmecontrol, camcontrol, ifconfig up with libxo
options.

So I agree with Mike Karels's post in the bug review on this...  We should
do it *NOW* for 15, document well the workarounds and collect data to see
if people are right about the scope. If so, we take a step back and do this
in 16. If not, we go forward. This will still give corporate users 2 or 3
years to get their act together for a release (dropping in the
IFCONFIG_FORMAT today in their scripts will work and keep them working well
into the future with all supported FreeBSD version, and then some).

Warner

On Sat, May 4, 2024 at 12:35 PM Tomoaki AOKI 
wrote:

> On Sat, 4 May 2024 16:34:03 +0100
> Lexi Winter  wrote:
>
> > hi,
> >
> > i've just submitted this PR:
> >
> > https://github.com/freebsd/freebsd-src/pull/1216
> >
> > which contains this commit:
> >
> > commit 57d273c90ee1c17446236aba25ed0bd291c4f126 (HEAD -> lf/main,
> hemlock/lf/main)
> > Author: Lexi Winter 
> > Date:   Sat May 4 16:11:21 2024 +0100
> >
> > ifconfig(8): change default IP address format to 'cidr'
> >
> > 'netmasks' haven't been used in IP networking for decades.  Change
> the
> > default address format for both IPv4 and IPv6 addreses in
> ifconfig(8) to
> > 'cidr', which prints addreses in the format most users will be more
> > familiar with.
> >
> > The previous format is still available using -finet:hex or
> -finet6:numeric.
> >
> > imp@ suggested i should ask arch@ and net@ about this, so here i am!
> >
> > i understand there might be some backward-compat concerns with scripting
> > here, but it's well past time this change was made, and anyone who
> > really can't update their scripts can use ifconfig -f or
> > $IFCONFIG_FORMAT to retain the old behaviour.
>
> Hi.
>
> If you raally want it to be landed, you should wait at least 2 major
> releases. Propagate the future change on Relesase Notes at 15.0, then,
> actually change in 16.0 shoule be the earliest. Maybe 17.0 would be
> reasonable.
>
> This could be t hazardous on corporate-class users having
> scripts/configurations for current style.
>
> We SHALL give enough YEARS for their admins to look into ALL their
> scripts/configuratins and fix everything affected. Moreover, if the
> fixes are widely affecting with their internal apps, they could need to
> acquire budgets to do so.
>
> Possibly, introducing environment variable set in /etc/defaults/rc.conf
> to select which format to use could help them. With it, they can set it
> to use current format for all their computers running FreeBSD until
> they fix all they need.
> Something like IP_FORMAT=CIDR or IP_FORMAT=NETMASK.
>
> Regards.
>
> --
> Tomoaki AOKI
>
>


Problem reports for n...@freebsd.org that need special attention

2024-05-05 Thread bugzilla-noreply
To view an individual PR, use:
  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id).

The following is a listing of current problems submitted by FreeBSD users,
which need special attention. These represent problem reports covering
all versions including experimental development code and obsolete releases.

Status  |Bug Id | Description
+---+---
New |254445 | cloned_interfaces="bridge0" does not respect net. 
Open|166724 | if_re(4): watchdog timeout
Open|200836 | iovctl(8): Return descriptions in the returned sc 
Open|223824 | Panic in ng_base.c (netgraph) 
Open|230807 | if_alc(4): Driver not working for Killer Networki 
Open|232472 | ixgbe(4): SR-IOV passthru not working on Hyper-V  
Open|234073 | ixl(4): Host X710-DA2 drops connect starting bhyv 
Open|241106 | tun/ppp: panic: vm_fault: fault on nofault entry  
Open|245981 | bnxt(4): BCM57414 / BCM57416 not initializing: bn 
Open|256217 | [tcp] High system load because of interrupts with 
Open|257038 | em(4): Panic on HTTP traffic to or from jail thro 
Open|257286 | gateway with `ping -6 -e` is ignored  
Open|258623 | cxgbe(4): Slow routing performance: 2 numa domain 
Open|258850 | lagg(4): interface vanishes when both member inte 
Open|261866 | ixgbe(4): Resets media type -> autoselect after s 
Open|262024 | em(4): iflib handles bad packets incorrectly  
Open|262093 | ixl(4): RX packet errors on Intel X710 after 12.2 
Open|263568 | ix(4): SR-IOV connection lost after loading VM wi 
In Progress |118111 | rc: network.subr Add MAC address based interface  

19 problems total for which you should take action.