# Speed issue - routing on the stick



## Ark76 (Aug 12, 2021)

Hi guys

I have installed FreeBSD on Mini PC with one ethernet inteface

```
gateway_enable="YES"
clear_tmp_enable="YES"
ifconfig_re0_name="eth1"
sshd_enable="YES"
ntpd_enable="YES"
dumpdev="NO"
#ip6addrctl_enable="NO"
#ipv6_activate_all_interfaces="NO"

## IPv6 ##
ipv6_network_interfaces="none"      # Default is auto
ipv6_activate_all_interfaces="NO"   # this is the default
ip6addrctl_enable="NO"              # New way to disable IPv6 support
ip6addrctl_policy="ipv4_prefer"     # Use IPv4 instead of IPv6
ipv6_activate_all_interfaces="NO"   # Do not automatically add IPv6 addresses

### SENDMAIL ###
sendmail_enable="NO"

### XINETD   ###
xinetd_enable="YES"

### ARP ###
sysctl -w net.link.ether.inet.max_age="600"
```

I have mikro lab ..
ETH1 = 172.23.200.13 - GW 172.23.200.13
On ETH1 create  vlan 1001
ifconfig vlan1001 create
ifconfig vlan1001 10.0.0.1 netmask 255.255.255.0 vlan 1001 vlandev eth1
Routing is fine - all working

But is problem with  traffic shaping with download for client  on vlan1001
Iam create simply rule on ipfw

```
ipfw add pipe 1 ip from any to any in
ipfw add pipe 2 ip from any to any out
ipfw pipe 1 config bw 5000Kb/s
ipfw pipe 2 config bw 5000Kb/s
```
Download is full speed
Upload is Fine - is shaping

Can you help me ...
Thanks

ps - of interface eth1 ## gateway IP ## download ## eg nload ## show max 10mbps -  upload show correctly ... any idea ??


----------



## SirDice (Aug 13, 2021)

Ark76 said:


> ```
> ### ARP ###
> sysctl -w net.link.ether.inet.max_age="600"
> ```


Remove this from /etc/rc.conf. _Never_ put commands in /etc/rc.conf. Please put it in sysctl.conf(5) where it belongs.


----------



## Ark76 (Aug 19, 2021)

I have installed FreeBSD on Mini PC with two ethernet - but I only want to use one ETH

rc.cof

```
gateway_enable="YES"
clear_tmp_enable="YES"
ifconfig_re0_name="eth1"
sshd_enable="YES"
ntpd_enable="YES"
dumpdev="NO"
#ip6addrctl_enable="NO"
#ipv6_activate_all_interfaces="NO"

## IPv6 ##
ipv6_network_interfaces="none"      # Default is auto
ipv6_activate_all_interfaces="NO"   # this is the default
ip6addrctl_enable="NO"              # New way to disable IPv6 support
ip6addrctl_policy="ipv4_prefer"     # Use IPv4 instead of IPv6
ipv6_activate_all_interfaces="NO"   # Do not automatically add IPv6 addresses

### SENDMAIL ###
sendmail_enable="NO"

### XINETD   ###
xinetd_enable="YES"
```
sysctl.conf

```
$FreeBSD$
#
#  This file is read when going to multi-user and its contents piped thru
#  ``sysctl'' to adjust kernel values.  ``man 5 sysctl.conf'' for details.
#

# Uncomment this to prevent users from seeing information about processes that
# are being run under another UID.
#security.bsd.see_other_uids=0
net.inet.ip.fw.one_pass=0

kern.coredump=0
net.core.rmem_max = 524288
net.core.wmem_max = 524288
net.inet.udp.strict_mcast_mship=24
machdep.hyperthreading_allowed=1

# nevyprsi platnost neaktivnych queue
net.inet.ip.dummynet.expire=0
net.inet.ip.dummynet.max_chain_len=128

net.link.ether.inet.log_arp_movements=0
net.link.ether.inet.log_arp_wrong_iface=0

net.inet.ip.dummynet.io_fast=1


net.link.lagg.default_use_flowid=0
# net.link.lagg.0.use_flowid=0
# net.link.lagg.1.use_flowid=0

### ARP ###
sysctl -w net.link.ether.inet.max_age="600"
#service netif stop eth0
```

/boot/loader.conf

```
autoboot_delay="2"
if_re_load="YES"
net.inet.ip.fw.default_to_accept=1
dummynet_load="YES"
ipfw_load="YES"
ipfw_nat_load="YES"
```


After boot  create IP on interface ETH1 an vlan

```
eth1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
        ether 00:0e:c4:d0:51:95
        inet 172.23.200.13 netmask 0xffffff00 broadcast 172.23.200.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

vlan1001: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80003<RXCSUM,TXCSUM,LINKSTATE>
        ether 00:0e:c4:d0:51:95
        inet 10.0.0.1 netmask 0xffffff00 broadcast 10.0.0.255
        groups: vlan
        vlan: 1001 vlanproto: 802.1q vlanpcp: 0 parent interface: eth1
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
```

I have one client on vlan1001
- 10.0.0.4
Al working. Net works correct, but I have test speed test
- speed download show max 10mbps  ( real speed 800mbps )
  - on eth1 or vlan1001
- speed upload show correct               ( real speed 800mbps )
If imake wget some file on BSD
wget IP:/file -O/dev/null
- then show momentary speed correctly .... 

In this time is all ipfw rulles flushed.

Please help - I'm a beginner


----------



## Ark76 (Aug 19, 2021)

My interface is :

```
re1@pci0:3:0:0: class=0x020000 rev=0x07 hdr=0x00 vendor=0x10ec device=0x8168 subvendor=0x10ec subdevice=0x0123
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller'
    class      = network
    subclass   = ethernet
```


----------



## SirDice (Aug 19, 2021)

```
if_re_load="YES"
```
You don't need to load it, re(4) is already included with the GENERIC kernel.



Ark76 said:


> speed download show max 10mbps ( real speed 800mbps )


Make sure you're measuring the same quantities. Network speeds are given in mega_bits_ per second and a lot of tools show speeds in mega_bytes_ per second. A gigabit interface has 1000 Mbit/s, which should roughly translate to a speed of 10 MBytes/s (there are 8 bits in a byte but you also need to take some networking overhead, so dividing by 10 gives a good enough approximation). Also a thing to remember with network speeds is that M and K are factors of 1000 while a lot of programs use factors of 1024 (similar to disk size issues). 

Rule of thumb, lower case b is bits, uppercase B is bytes. So 1000 Mb/s is 10 MB/s. Or better to avoid any ambiguity and say 1000 Mbit/s is roughly 10 MBytes/s.


----------



## SirDice (Aug 19, 2021)

Please don't post the same question multiple times. Threads merged.


----------

