LINUX.ORG.RU
ФорумAdmin

Трудности с настройкой bridge

 , ,


0

1

Всем добрый день ! Я пробую в fedora 35 настроить bridge при помощи nmcli. Исходное положение ip 192.168.0.124/24 сам хост, ip 192.168.0.1/24 роутер, выхлоп 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: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:e6:f7:13 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.124/24 brd 192.168.0.255 scope global dynamic noprefixroute enp0s3
       valid_lft 536sec preferred_lft 536sec
    inet6 fe80::f346:a1f5:336:3145/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

Выхлоп nmcli con show:

NAME    UUID                                  TYPE      DEVICE 
enp0s3  4db56e9d-5a76-4566-9bd9-b82192e7db16  ethernet  enp0s3

Настраиваю мост при помощи последовательности команд:

  1. nmcli con add ifname br0 type bridge con-name br0
  2. nmcli con add type bridge-slave ifname enp0s3 master br0
  3. nmcli con modify br0 bridge.stp no
  4. nmcli con down enp0s3
  5. nmcli con up br0

После чего соответственно получаю:

NAME                 UUID                                  TYPE      DEVICE 
br0                  bbf7113b-4a4e-4c38-98f7-4f59f1ae5682  bridge    br0    
bridge-slave-enp0s3  71e9de6b-b546-458f-8e20-d85cb21e9c57  ethernet  enp0s3 
enp0s3               4db56e9d-5a76-4566-9bd9-b82192e7db16  ethernet  -- 
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: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
    link/ether 08:00:27:e6:f7:13 brd ff:ff:ff:ff:ff:ff
20: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 9a:5a:10:6c:18:40 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.123/24 brd 192.168.0.255 scope global dynamic noprefixroute br0
       valid_lft 524sec preferred_lft 524sec
    inet6 fe80::67fd:7e33:3e7:8cc3/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

В результате чего получаю то что мост не работает, пинги на роутер не идут.

PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
From 192.168.0.123 icmp_seq=1 Destination Host Unreachable
From 192.168.0.123 icmp_seq=2 Destination Host Unreachable
From 192.168.0.123 icmp_seq=3 Destination Host Unreachable
From 192.168.0.123 icmp_seq=4 Destination Host Unreachable
From 192.168.0.123 icmp_seq=5 Destination Host Unreachable

Проверил модуль ядра при помощи lsmod | grep bridge

bridge                315392  0
stp                    16384  1 bridge
llc                    16384  2 bridge,stp

Selinux и firwalld.service выключены. Включил net.ipv4.ip_forward=1.

Параметры nmcli con show br0:

connection.id:                          br0
connection.uuid:                        bbf7113b-4a4e-4c38-98f7-4f59f1ae5682
connection.stable-id:                   --
connection.type:                        bridge
connection.interface-name:              br0
connection.autoconnect:                 да
connection.autoconnect-priority:        0
connection.autoconnect-retries:         -1 (default)
connection.multi-connect:               0 (default)
connection.auth-retries:                -1
connection.timestamp:                   1637764723
connection.read-only:                   нет
connection.permissions:                 --
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:                 --
connection.gateway-ping-timeout:        0
connection.metered:                     неизвестно
connection.lldp:                        default
connection.mdns:                        -1 (default)
connection.llmnr:                       -1 (default)
connection.wait-device-timeout:         -1
ipv4.method:                            auto
ipv4.dns:                               --
ipv4.dns-search:                        --
ipv4.dns-options:                       --
ipv4.dns-priority:                      0
ipv4.addresses:                         --
ipv4.gateway:                           --
ipv4.routes:                            --
ipv4.route-metric:                      -1
ipv4.route-table:                       0 (unspec)
ipv4.routing-rules:                     --
ipv4.ignore-auto-routes:                нет
ipv4.ignore-auto-dns:                   нет
ipv4.dhcp-client-id:                    --
ipv4.dhcp-iaid:                         --
ipv4.dhcp-timeout:                      0 (default)
ipv4.dhcp-send-hostname:                да
ipv4.dhcp-hostname:                     --
ipv4.dhcp-fqdn:                         --
ipv4.dhcp-hostname-flags:               0x0 (none)
ipv4.never-default:                     нет
ipv4.may-fail:                          да
ipv4.required-timeout:                  -1 (default)
ipv4.dad-timeout:                       -1 (default)
ipv4.dhcp-vendor-class-identifier:      --
ipv4.dhcp-reject-servers:               --
ipv6.method:                            auto
ipv6.dns:                               --
ipv6.dns-search:                        --
ipv6.dns-options:                       --
ipv6.dns-priority:                      0
ipv6.addresses:                         --
ipv6.gateway:                           --
ipv6.routes:                            --
ipv6.route-metric:                      -1
ipv6.route-table:                       0 (unspec)
ipv6.routing-rules:                     --
ipv6.ignore-auto-routes:                нет
ipv6.ignore-auto-dns:                   нет
ipv6.never-default:                     нет
ipv6.may-fail:                          да
ipv6.required-timeout:                  -1 (default)
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.addr-gen-mode:                     stable-privacy
ipv6.ra-timeout:                        0 (default)
ipv6.dhcp-duid:                         --
ipv6.dhcp-iaid:                         --
ipv6.dhcp-timeout:                      0 (default)
ipv6.dhcp-send-hostname:                да
ipv6.dhcp-hostname:                     --
ipv6.dhcp-hostname-flags:               0x0 (none)
ipv6.token:                             --
bridge.mac-address:                     --
bridge.stp:                             да
bridge.priority:                        32768
bridge.forward-delay:                   15
bridge.hello-time:                      2
bridge.max-age:                         20
bridge.ageing-time:                     300
bridge.group-forward-mask:              0
bridge.multicast-snooping:              да
bridge.vlan-filtering:                  нет
bridge.vlan-default-pvid:               1
bridge.vlans:                           --
proxy.method:                           none
proxy.browser-only:                     нет
proxy.pac-url:                          --
proxy.pac-script:                       --
GENERAL.NAME:                           br0
GENERAL.UUID:                           bbf7113b-4a4e-4c38-98f7-4f59f1ae5682
GENERAL.DEVICES:                        br0
GENERAL.IP-IFACE:                       br0
GENERAL.STATE:                          активировано
GENERAL.DEFAULT:                        да
GENERAL.DEFAULT6:                       нет
GENERAL.SPEC-OBJECT:                    --
GENERAL.VPN:                            нет
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/20
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/7
GENERAL.ZONE:                           --
GENERAL.MASTER-PATH:                    --
IP4.ADDRESS[1]:                         192.168.0.123/24
IP4.GATEWAY:                            192.168.0.1
IP4.ROUTE[1]:                           dst = 0.0.0.0/0, nh = 192.168.0.1, mt = 425
IP4.ROUTE[2]:                           dst = 192.168.0.0/24, nh = 0.0.0.0, mt = 425
IP4.DNS[1]:                             10.0.1.9
IP4.DNS[2]:                             10.0.1.14
IP4.DNS[3]:                             192.168.88.1
DHCP4.OPTION[1]:                        dhcp_lease_time = 600
DHCP4.OPTION[2]:                        dhcp_server_identifier = 192.168.0.1
DHCP4.OPTION[3]:                        domain_name_servers = 10.0.1.9 10.0.1.14 192.168.88.1
DHCP4.OPTION[4]:                        expiry = 1637765323
DHCP4.OPTION[5]:                        ip_address = 192.168.0.123
DHCP4.OPTION[6]:                        next_server = 192.168.0.1
DHCP4.OPTION[7]:                        requested_broadcast_address = 1
DHCP4.OPTION[8]:                        requested_domain_name = 1
DHCP4.OPTION[9]:                        requested_domain_name_servers = 1
DHCP4.OPTION[10]:                       requested_domain_search = 1
DHCP4.OPTION[11]:                       requested_host_name = 1
DHCP4.OPTION[12]:                       requested_interface_mtu = 1
DHCP4.OPTION[13]:                       requested_ms_classless_static_routes = 1
DHCP4.OPTION[14]:                       requested_nis_domain = 1
DHCP4.OPTION[15]:                       requested_nis_servers = 1
DHCP4.OPTION[16]:                       requested_ntp_servers = 1
DHCP4.OPTION[17]:                       requested_rfc3442_classless_static_routes = 1
DHCP4.OPTION[18]:                       requested_root_path = 1
DHCP4.OPTION[19]:                       requested_routers = 1
DHCP4.OPTION[20]:                       requested_static_routes = 1
DHCP4.OPTION[21]:                       requested_subnet_mask = 1
DHCP4.OPTION[22]:                       requested_time_offset = 1
DHCP4.OPTION[23]:                       requested_wpad = 1
DHCP4.OPTION[24]:                       routers = 192.168.0.1
DHCP4.OPTION[25]:                       subnet_mask = 255.255.255.0
IP6.ADDRESS[1]:                         fe80::67fd:7e33:3e7:8cc3/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 425

Параметры bridge-slave-enp0s3:

connection.id:                          bridge-slave-enp0s3
connection.uuid:                        71e9de6b-b546-458f-8e20-d85cb21e9c57
connection.stable-id:                   --
connection.type:                        802-3-ethernet
connection.interface-name:              enp0s3
connection.autoconnect:                 да
connection.autoconnect-priority:        0
connection.autoconnect-retries:         -1 (default)
connection.multi-connect:               0 (default)
connection.auth-retries:                -1
connection.timestamp:                   1637764885
connection.read-only:                   нет
connection.permissions:                 --
connection.zone:                        --
connection.master:                      br0
connection.slave-type:                  bridge
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:                 --
connection.gateway-ping-timeout:        0
connection.metered:                     неизвестно
connection.lldp:                        default
connection.mdns:                        -1 (default)
connection.llmnr:                       -1 (default)
connection.wait-device-timeout:         -1
802-3-ethernet.port:                    --
802-3-ethernet.speed:                   0
802-3-ethernet.duplex:                  --
802-3-ethernet.auto-negotiate:          нет
802-3-ethernet.mac-address:             --
802-3-ethernet.cloned-mac-address:      --
802-3-ethernet.generate-mac-address-mask:--
802-3-ethernet.mac-address-blacklist:   --
802-3-ethernet.mtu:                     автоматически
802-3-ethernet.s390-subchannels:        --
802-3-ethernet.s390-nettype:            --
802-3-ethernet.s390-options:            --
802-3-ethernet.wake-on-lan:             default
802-3-ethernet.wake-on-lan-password:    --
802-3-ethernet.accept-all-mac-addresses:-1 (default)
bridge-port.priority:                   32
bridge-port.path-cost:                  100
bridge-port.hairpin-mode:               нет
bridge-port.vlans:                      --
GENERAL.NAME:                           bridge-slave-enp0s3
GENERAL.UUID:                           71e9de6b-b546-458f-8e20-d85cb21e9c57
GENERAL.DEVICES:                        enp0s3
GENERAL.IP-IFACE:                       enp0s3
GENERAL.STATE:                          активировано
GENERAL.DEFAULT:                        нет
GENERAL.DEFAULT6:                       нет
GENERAL.SPEC-OBJECT:                    --
GENERAL.VPN:                            нет
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/21
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/8
GENERAL.ZONE:                           --
GENERAL.MASTER-PATH:                    /org/freedesktop/NetworkManager/Devices/7
IP4.GATEWAY:                            --
IP6.GATEWAY:                            --

По инструкции вроде все должно работать, но у меня ничего не получается. Два дня интенсивного гугления ничего не дали. Может кто нибуть что то подскажет куда смотреть и что ище проверть ?



Последнее исправление: alpha (всего исправлений: 2)

Нарисуй схему сети и покажи вывод brctl show.

anonymous
()
Ответ на: Спасибо от f100

Теперь еще и заголовок поправьте.

anc ★★★★★
()

Что показывают команды ″nmcli device status″, ″bridge link show″, ″bridge fdb show″?

mky ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.