Linux 网络笔记

                     

贡献者: addis

1. ip 命令

   ip a(或者 ip addr)输出的的一个例子如下:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state 
UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
fq_codel state UP group default qlen 1000
    link/ether d8:bb:c1:17:da:ca brd ff:ff:ff:ff:ff:ff
    inet 192.168.137.1/24 brd 192.168.137.255 scope global 
noprefixroute enp3s0
       valid_lft forever preferred_lft forever
    inet6 fe80::dabb:c1ff:fe17:daca/64 scope link 
       valid_lft forever preferred_lft forever
3: wlo1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
noqueue state UP group default qlen 1000
    link/ether 14:18:c3:7f:91:85 brd ff:ff:ff:ff:ff:ff
    altname wlp0s20f3
    inet 10.150.61.141/17 brd 10.150.127.255 scope global 
dynamic noprefixroute wlo1
       valid_lft 66898sec preferred_lft 66898sec
    inet6 fe80::e7b9:9ec8:8534:38d2/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

2. iptables 和 ufw

直接操作 iptable

3. 调试工具

4. 用 Virtualbox 搭建局域网

5. netplan

图
图 2:netplan 的结构

6. 配置静态 ip 以及 routing table

7. NAT

Ubuntu 22.04

Ubuntu 20.04

                     

© 小时科技 保留一切权利