2025年3月17日 星期一

2025 My Hardware Personal Computer Used

 2025 My Hardware Personal Computer Used


Check
Ubunut
sudo dmidecode -t 2
sudo lsblk -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,MODEL


2025

Intel(R) Core(TM) i9-14900 HKD$4300 @ 2025
24C 32T 65W Single 4411 Multi 46288

ASUSTeK COMPUTER INC.
PRIME Z790M-PLUS
Intel® Z790 Chipset
3x M.2 PCIe 4.0 x4
4x SATA 6Gb/s
1GbE

Samsung SSD 990 EVO 1TB PCIe 4.0 x4 HKD$500 @2025

2021

AMD Ryzen 7 3700x
8C 16T 65W Single 2658 Multi 22494

ASUSTeK COMPUTER INC.
TUF GAMING B550M-PLUS
AMD B550
2x M.2 PCIe 3.0 x4
4x SATA 6Gb/s

ADATA SX8200PNP PCIe Gen3 x4 HKD$580 @2021

2025年3月13日 星期四

2025 NVME Disk Speed Test


# tool
sudo apt install nvme-cli

# mytest 01 3.6 GB/s Samsung SSD 990 EVO 1TB HKD$500
native Asus onboard nvme
sudo nvme list
Samsung SSD 990 EVO 1TB
$ time dd if=/dev/zero of=testfile bs=16k count=128k
131072+0 records in
131072+0 records out
2147483648 bytes (2.1 GB, 2.0 GiB) copied, 0.599403 s, 3.6 GB/s

# mytest 02 112 MB/s FreeNas NVME HKD$430
NVME over FreeNAS and TPLINK 1Gbe Switch
sudo nvme list
ADATA SX8200PNP
$ time dd if=/dev/zero of=/mnt/ricky/testfile bs=16k count=128k
131072+0 records in
131072+0 records out
2147483648 bytes (2.1 GB, 2.0 GiB) copied, 19.0907 s, 112 MB/s


# test

TEST: Samsung 990 EVO 1TB M.2 SSD
Read speed 5000 MB/s
Write speed 4200 MB/s
Interface PCIe 4.0 x4

TEST: ADATA XPG SX8200 Pro 1TB M.2 SSD
Read speed 3500 MB/s
Write speed 2800 MB/s
Interface PCIe 3.0 x4


# Network

1 Gbps = 125 MB/s
2.5 Gbps = 312.5 MB/s
10 Gbps = 1250 MB/s = 1.25 GB/s
25 Gbps = 3125 MB/s = 3.125 GB/s
40 Gbps = 5000 MB/s = 5 GB/s


# NVME

https://ssd-tester.com/m2_ssd_test.php?sort=&sort_interface=PCIe+5.0+x4

The following speed transfer rates are possible: Theoretical Practical

SATA 3 6 GBit/s (=750 MB/s) ~550 MB/s
PCIe 2.0 x2 10 GBit/s (=1.250 MB/s) ~800 MB/s
PCIe 2.0 x4 20 GBit/s (=2.500 MB/s) ~1,600 MB/s
PCIe 3.0 x2 16 GBit/s (=2.000 MB/s) ~1,600 MB/s
PCIe 3.0 x4 32 GBit/s (=4.000 MB/s) ~3,500 MB/s
PCIe 4.0 x4 64 GBit/s (=8.000 MB/s) ~7,500 MB/s
PCIe 5.0 x4 128 GBit/s (=16.000 MB/s) ~15,000 MB/s




2025年1月22日 星期三

202501 Debian USB LAN Card Bridge

 202501 Debian USB LAN Card Bridge


ChatGPT Question

I have a machine running debian 12 with a LAN port using a cable to connect to my office and can obtain below ip address correctly

2: enp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether f0:2f:74:2e:57:ea brd ff:ff:ff:ff:ff:ff
inet 10.20.15.101/24 brd 10.20.15.255 scope global dynamic noprefixroute enp6s0
valid_lft 82884sec preferred_lft 82884sec
inet6 fe80::f22f:74ff:fe2e:57ea/64 scope link noprefixroute
valid_lft forever preferred_lft forever

Now i want to add another NIC enx8cb0e9c91446 to that machine and allow another client machine to connect to this newly added NIC so that that client machines can also obtain ip address from that NIC as if that client machine is connect to the same subnet. How?


ChatGPT Answer (does not work, do not directly use)

To allow another client machine to connect to your Debian 12 machine via the newly added NIC enx8cb0e9c91446 and obtain an IP address from the same subnet, you can set up the new NIC as a bridge interface. This will enable the client machine to be on the same subnet and communicate with other devices in the network. Here's how you can achieve this:

  1. Identify the New NIC: First, ensure that the new NIC enx8cb0e9c91446 is properly identified and recognized by your Debian 12 system.

  2. Install Bridge Utilities (if needed): If the bridge utilities package is not already installed on your system, you can install it by running:

    sudo apt update
    sudo apt install bridge-utils
    
  3. Configure the Bridge Interface: Create a bridge interface that includes both enp6s0 and enx8cb0e9c91446. You can create a bridge configuration file in the /etc/network/interfaces.d/ directory. Here's an example configuration for the bridge interface:

    Add the following configuration to a new file, for example, /etc/network/interfaces.d/br0:

    auto enp6s0
    iface enp6s0 inet manual
    
    auto enx8cb0e9c91446
    iface enx8cb0e9c91446 inet manual
    
    auto br0
    iface br0 inet dhcp
        bridge_ports enp6s0 enx8cb0e9c91446
    
  4. Restart Networking Service:
    After saving the configuration, you can restart the networking service to apply the changes:

    sudo systemctl restart networking
    
  5. Verify the Bridge Configuration:
    You can verify that the bridge interface is created and both NICs are part of it by running:

    ip addr show br0
    
  6. Connect the Client Machine:
    Connect the client machine to the new NIC enx8cb0e9c91446. The client machine should now be able to obtain an IP address from the same subnet as 10.20.15.101 and communicate with other devices on the network.

By setting up a bridge interface in Debian 12, you are allowing the new client machine to be on the same subnet as your original NIC enp6s0, enabling seamless communication within the network. If you have any questions or need further assistance, feel free to ask.


Exercise

before

cat /etc/*release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"

ls /etc/network/interfaces.d
echo nothing

$ ip -br a
lo               UNKNOWN        127.0.0.1/8 ::1/128 
enp6s0           UP             10.20.15.101/24 fe80::f22f:74ff:fe2e:57ea/64 
docker0          DOWN           172.17.0.1/16 fe80::42:fdff:feea:3e0f/64 
enx8cb0e9c91446  DOWN   

reference

https://wiki.debian.org/BridgeNetworkConnections

action (will work)

sudo touch /etc/network/interfaces.d/br0
sudo nano /etc/network/interfaces.d/br0

cat /etc/network/interfaces.d/br0 
auto lo
iface lo inet loopback
iface enp6s0 inet manual
iface enx8cb0e9c91446 inet manual
auto br0
iface br0 inet dhcp
    bridge_ports enp6s0 enx8cb0e9c91446

sudo systemctl restart networking

after

ip -br a
lo               UNKNOWN        127.0.0.1/8 ::1/128
enp6s0           UP             10.20.15.101/24 fe80::f22f:74ff:fe2e:57ea/64
docker0          DOWN           172.17.0.1/16 fe80::42:fdff:feea:3e0f/64
enx8cb0e9c91446  DOWN           
br0              UP             10.20.15.127/24 fe80::384e:eaff:fe87:beca/64


how to use have the original ip address 10.20.15.101 for br0?

Ask ChatGPT

my br0 now has an ip address 10.20.15.127 from dhcp. now i want to use keepalived so that it attach an virtual ip address 10.20.15.101 so that other users using 10.20.15.101:24000 will be redirect to 10.20.15.127:24000. how?

sudo apt update
sudo apt install keepalived

$ cat /etc/keepalived/keepalived.conf

global_defs {

router_id keepalived_node

}


vrrp_instance VI_1 {

state MASTER

interface br0

virtual_router_id 51

priority 100

advert_int 1

authentication {

auth_type PASS

auth_pass your_password

}

virtual_ipaddress {

10.20.15.101

}

}


virtual_server 10.20.15.101 24000 {

delay_loop 2

lb_algo rr

lb_kind NAT

persistence_timeout 0

protocol TCP


real_server 10.20.15.127 24000 {

weight 1

TCP_CHECK {

connect_timeout 3

nb_get_retry 3

delay_before_retry 3

}

}

}

sudo systemctl restart keepalived

$ ip -br a

lo UNKNOWN 127.0.0.1/8 ::1/128

enp6s0 UP

docker0 DOWN 172.17.0.1/16 fe80::42:fdff:feea:3e0f/64

enx8cb0e9c91446 DOWN

br0 UP 10.20.15.127/24 10.20.15.101/32 fe80::384e:eaff:fe87:beca/64

enx00e04c534458 DOWN





2025 My Hardware Personal Computer Used

 2025 My Hardware Personal Computer Used Check Ubunut sudo dmidecode -t 2 sudo lsblk -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,MODEL 2025 Intel(R...