#!/bin/sh
################################################## ##
#
# creates a bridge between eth0 and wlan0
# and set the ip address to 192.168.180.222
# sets defaultGateway and resets the interface ip
#
################################################## ##
insmod /lib/modules/stp.ko
insmod /lib/modules/bridge.ko
brctl addbr br0
brctl stp br0 off
#iface eth0 inet manual
#iface wlan0 inet manual
ifconfig br0 192.168.180.222 netmask 255.255.255.0 up
#ifconfig br0 dynamic up
brctl addif br0 eth0
brctl addif br0 wlan0
ifconfig eth0 0.0.0.0 promisc up
ifconfig wlan0 0.0.0.0 promisc up
route add default gw 192.168.180.1 dev br0
iptables -t nat -A POSTROUTING -s 192.168.180.0/24 -j MASQUERADE
exit
root@Syno:~# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.803f5d219e98 no eth0
wlan0
br0 Link encap:Ethernet HWaddr 80:3F:5D:21:9E:98
inet addr:192.168.180.222 Bcast:192.168.180.255 Mask:255.255.255.0
inet6 addr: fe80::4099:3fff:fec5:c39c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:2802 errors:0 dropped:0 overruns:0 frame:0
TX packets:340 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:378029 (369.1 KiB) TX bytes:67964 (66.3 KiB)
eth0 Link encap:Ethernet HWaddr A0:B3:CC:E9:5C:0F
inet addr:169.254.192.23 Bcast:169.254.255.255 Mask:255.255.0.0
inet6 addr: fe80::a2b3:ccff:fee9:5c0f/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:2034 errors:0 dropped:0 overruns:0 frame:0
TX packets:424 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:303952 (296.8 KiB) TX bytes:102240 (99.8 KiB)
eth1 Link encap:Ethernet HWaddr A0:B3:CC:E9:5C:0F
inet addr:192.168.180.109 Bcast:192.168.180.255 Mask:255.255.255.0
inet6 addr: 2001:16b8:24e5:3b00:a2b3:ccff:fee9:5c0f/64 Scope:Global
inet6 addr: fd9f:7989:a27d::7d1/64 Scope:Global
inet6 addr: fd9f:7989:a27d:0:a2b3:ccff:fee9:5c0f/64 Scope:Global
inet6 addr: fe80::a2b3:ccff:fee9:5c0f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7646651 errors:0 dropped:0 overruns:0 frame:0
TX packets:1222798 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8618128324 (8.0 GiB) TX bytes:126255037 (120.4 MiB)
Interrupt:18
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:10364 errors:0 dropped:0 overruns:0 frame:0
TX packets:10364 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1690129 (1.6 MiB) TX bytes:1690129 (1.6 MiB)
wlan0 Link encap:Ethernet HWaddr 80:3F:5D:21:9E:98
inet addr:169.254.205.99 Bcast:169.254.255.255 Mask:255.255.0.0
inet6 addr: 2001:16b8:24e5:3b00:823f:5dff:fe21:9e98/64 Scope:Global
inet6 addr: fd9f:7989:a27d:0:823f:5dff:fe21:9e98/64 Scope:Global
inet6 addr: fe80::823f:5dff:fe21:9e98/64 Scope:Link
inet6 addr: fd9f:7989:a27d::41a/64 Scope:Global
UP BROADCAST PROMISC MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:1322 overruns:0 frame:0
TX packets:0 errors:0 dropped:25 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:329577666 (314.3 MiB) TX bytes:8195088 (7.8 MiB)
ifconfig br0 down
brctl delbr br0
brctl addbr br0
brctl stp br0 off
ifconfig br0 192.168.178.6 netmask 255.255.255.0 up
brctl addif br0 eth1
brctl addif br0 eth4
ifconfig eth4 192.168.178.6 promisc up
route add default gw 192.168.178.1 dev br0
ifconfig eth1 192.168.178.6 promisc up
brctl show
bridge name bridge id STP enabled interfaces
br0 8000.0011329f8290 no eth1
eth4
ifconfig
br0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.178.6 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: 0000::000:32ff:fe9f:0000/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:668663 errors:0 dropped:0 overruns:0 frame:0
TX packets:531475 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:40318789 (38.4 MiB) TX bytes:7896566361 (7.3 GiB)
eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.178.5 Bcast:192.168.178.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:10962738 errors:0 dropped:0 overruns:0 frame:0
TX packets:48922559 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4726403762 (4.4 GiB) TX bytes:72130182281 (67.1 GiB)
eth1 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.178.6 Bcast:192.168.178.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:28475132 errors:0 dropped:0 overruns:0 frame:0
TX packets:6812635 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:39044541034 (36.3 GiB) TX bytes:6914357045 (6.4 GiB)
eth2 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:169.254.59.92 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth3 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:169.254.35.224 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:54705 errors:0 dropped:0 overruns:0 frame:0
TX packets:332501 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4268817 (4.0 MiB) TX bytes:498986105 (475.8 MiB)
eth4 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.178.10 Bcast:192.168.178.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:17427855 errors:0 dropped:0 overruns:0 frame:0
TX packets:31960262 errors:3 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21490017029 (20.0 GiB) TX bytes:46763352068 (43.5 GiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:516026 errors:0 dropped:0 overruns:0 frame:0
TX packets:516026 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:110015675 (104.9 MiB) TX bytes:110015675 (104.9 MiB)
ifconfig br0 inet6 del 0000::000:32ff:fe9f:0000/64
ifconfig eth1 192.168.178.7 promisc up
ifconfig eth4 192.168.178.7 promisc up
Promisc(ious) bedeutet, dass alle Pakete am Interface abgehört werden sollen, also auch jene, die eigentlich nicht für das jeweilige Ethernet Device bestimmt sind
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default fritz.box 0.0.0.0 UG 0 0 0 eth4
default fritz.box 0.0.0.0 UG 0 0 0 br0
default fritz.box 0.0.0.0 UG 0 0 0 eth1
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
route del -net 192.168.2.0 netmask 255.255.255.0 gw 0.0.0.0
ifconfig eth4 192.168.178.10
route add default gw 192.168.178.1 dev eth4
ifconfig eth1 0.0.0.0
eth4 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.2.10 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST PROMISC MULTICAST MTU:1500 Metric:1
RX packets:133662059 errors:0 dropped:0 overruns:0 frame:0
TX packets:57330917 errors:3 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:184600596405 (171.9 GiB) TX bytes:69729278354 (64.9 GiB)
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default fritz.box 0.0.0.0 UG 0 0 0 eth1
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
ifconfig eth4 192.168.178.6
eth4 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.178.6 Bcast:192.168.178.255 Mask:255.255.255.0
UP BROADCAST PROMISC MULTICAST MTU:1500 Metric:1
RX packets:133662059 errors:0 dropped:0 overruns:0 frame:0
TX packets:57330917 errors:3 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:184600596405 (171.9 GiB) TX bytes:69729278354 (64.9 GiB)
route add default gw 192.168.178.1 dev eth4
SIOCADDRT: Network is unreachable
ifconfig br0 down
ifconfig br0 up
UP BROADCAST RUNNING PROMISC MULTICAST
UP BROADCAST PROMISC MULTICAST
ifconfig eth4 down
ifconfig eth4 192.168.178.6 promisc up
RUNNING signifies that the network driver has been loaded and has initialized the interface.
eth4 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.2.10 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:133662600 errors:0 dropped:0 overruns:0 frame:0
TX packets:57335239 errors:3 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:184600662334 (171.9 GiB) TX bytes:69729833996 (64.9 GiB)
eth4 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.178.6 Bcast:192.168.178.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:133662620 errors:0 dropped:0 overruns:0 frame:0
TX packets:57335918 errors:3 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:184600664238 (171.9 GiB) TX bytes:69729925812 (64.9 GiB)
route add default gw 192.168.178.1 dev eth4
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default fritz.box 0.0.0.0 UG 0 0 0 eth4
default fritz.box 0.0.0.0 UG 0 0 0 eth1
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
ifconfig eth3 192.168.178.10
ash-4.3# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default fritz.box 0.0.0.0 UG 0 0 0 eth3
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
ash-4.3# route add default gw 192.168.178.1 dev br0
ash-4.3# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default fritz.box 0.0.0.0 UG 0 0 0 br0
default fritz.box 0.0.0.0 UG 0 0 0 eth3
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
ash-4.3# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default fritz.box 0.0.0.0 UG 0 0 0 eth4
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
ash-4.3#
ifconfig eth3 192.168.178.6 promisc up
ifconfig eth4 192.168.178.6 promisc up
ash-4.3# ifconfig
br0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.178.12 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: 0000::000:0000:0000:0000/64 Scope:Link
inet6 addr: 000::000:000:0000:0000/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:812776 errors:0 dropped:0 overruns:0 frame:0
TX packets:241339 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:100013045 (95.3 MiB) TX bytes:4347391767 (4.0 GiB)
eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.178.5 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: 0000::000:0000:0000:0000/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:11580571 errors:0 dropped:0 overruns:0 frame:0
TX packets:50079196 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4814848398 (4.4 GiB) TX bytes:73745340292 (68.6 GiB)
eth1 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.178.6 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: 000::000:000:0000:0000/64 Scope:Global
inet6 addr: 0000::000:0000:0000:0000/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:49126308 errors:0 dropped:0 overruns:0 frame:0
TX packets:44879729 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:40999907867 (38.1 GiB) TX bytes:62875687435 (58.5 GiB)
eth2 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.178.7 Bcast:192.168.178.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth3 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.178.10 Bcast:192.168.178.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:2084796 errors:0 dropped:0 overruns:0 frame:0
TX packets:1248069 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2279335363 (2.1 GiB) TX bytes:1658099303 (1.5 GiB)
eth4 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.178.11 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: 0000::000:0000:0000:0000/64 Scope:Link
UP BROADCAST PROMISC MULTICAST MTU:1500 Metric:1
RX packets:134012972 errors:0 dropped:0 overruns:0 frame:0
TX packets:61288649 errors:4 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:184643463135 (171.9 GiB) TX bytes:75331805322 (70.1 GiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1091111 errors:0 dropped:0 overruns:0 frame:0
TX packets:1091111 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:247892823 (236.4 MiB) TX bytes:247892823 (236.4 MiB)
ash-4.3# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default fritz.box 0.0.0.0 UG 0 0 0 eth1
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
ash-4.3# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.000000000000 no eth3
eth4
#!/bin/sh
# Load the required kernel modules
insmod /lib/modules/stp.ko
insmod /lib/modules/bridge.ko
# stop execution if bridge already exists
if ethtool br0 2>/dev/null | grep -q "Link detected: yes"; then
echo "Bridge already exists!"
exit 0;
fi
# stop if first ethernet port is disconnected (trouble fallback)
if ! ethtool eth3 2>/dev/null | grep -q "Link detected: yes"; then
echo "The first bridge port is not connected!"
exit 1;
fi
# stop if second ethernet port is disconnected (trouble fallback)
if ! ethtool eth4 2>/dev/null | grep -q "Link detected: yes"; then
echo "The second bridge port is not connected!"
exit 1;
fi
# add bridge
brctl addbr br0
brctl stp br0 off
# set bridge ip
ifconfig br0 192.168.178.12 netmask 255.255.255.0 up
# add ethernet ports to bridge
brctl addif br0 eth3
brctl addif br0 eth4
# unset ips of ethernet ports and process all network traffic
#ifconfig eth3 0.0.0.0 promisc up
#ifconfig eth4 0.0.0.0 promisc up
# add gateway to bridge
#route add default gw 192.168.178.1 dev br0
tracert DISKSTATION
Routenverfolgung zu DISKSTATION [192.168.178.12]
über maximal 30 Hops:
1 <1 ms <1 ms <1 ms DISKSTATION [192.168.178.12]
Ablaufverfolgung beendet.
ethtool eth4
Settings for eth4:
Supported ports: [ TP ]
Supported link modes: 100baseT/Full
1000baseT/Full
10000baseT/Full
Supported pause frame use: Symmetric
Supports auto-negotiation: Yes
Advertised link modes: 100baseT/Full
1000baseT/Full
10000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Speed: 10000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: external
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: g
Wake-on: d
Link detected: yes
br0 Link encap:Ethernet HWaddr 00:00:00:00:82:92
inet addr:192.168.178.12 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: fe80::203e:0000:0000:f74b/64 Scope:Link
inet6 addr: fd00::211:0000:0000:8292/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:134487 errors:0 dropped:0 overruns:0 frame:0
TX packets:408422 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19607792 (18.6 MiB) TX bytes:6008324607 (5.5 GiB)
...
eth3 Link encap:Ethernet HWaddr 00:00:00:00:82:92
inet addr:192.168.178.10 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: fd00::211:0000:0000:8292/64 Scope:Global
inet6 addr: fe80::211:0000:0000:8292/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:588748 errors:0 dropped:0 overruns:0 frame:0
TX packets:513984 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:643879170 (614.0 MiB) TX bytes:668674182 (637.6 MiB)
eth4 Link encap:Ethernet HWaddr 00:00:00:00:66:6B
inet addr:192.168.178.11 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: fe80::211:0000:0000:666b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:281550 errors:0 dropped:0 overruns:0 frame:0
TX packets:4307070 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:47286825 (45.0 MiB) TX bytes:6211401390 (5.7 GiB)
#!/bin/sh
################################################################################
# Ethernet bridge for Synology v0.2
#
# notes:
# - let this script run on boot with root privileges
# - this script creates a bridge between LAN4 (eth3, 1G) and LAN5 (eth4, 10G)
# - the bridge gets the IP 192.168.178.12 (change it to your needs)
# - if LAN4 is not connected to a switch it skips bridge creation (fallback in case of troubles)
# - you need to set fixed IPs for LAN4 and LAN5 through DSM that are different from the bridge!
# - if you manually restart the script it will re-create the bridge (maybe useful for debugging purposes)
#
################################################################################
# Load the required kernel modules
insmod /lib/modules/stp.ko
insmod /lib/modules/bridge.ko
# remove bridge if it already exists
if ethtool br0 2>/dev/null | grep -q "Link detected: yes"; then
ifconfig br0 down
brctl delbr br0
echo "Already existing LAN-Bridge has been removed!"
fi
# stop if first ethernet port is disconnected (trouble fallback)
if ! ethtool eth3 2>/dev/null | grep -q "Link detected: yes"; then
echo "LAN-Bridge not created. The first bridge port is not connected!"
exit 1
fi
# add bridge
brctl addbr br0
brctl stp br0 off
# set bridge ip
ifconfig br0 192.168.178.12 netmask 255.255.255.0 up
# add ethernet ports to bridge
brctl addif br0 eth3
brctl addif br0 eth4
# process any network traffic
#ifconfig eth3 promisc up
#ifconfig eth4 promisc up
# set bridge mac address to eth4
#ip link set br0 address 00:00:00:00:66:6B
# add routes
route add -net 192.168.178.0 netmask 255.255.255.0 dev br0
route add default gw 192.168.178.1 dev br0
eth4 Link encap:Ethernet HWaddr 00:00:00:00:66:6B
inet addr:192.168.178.11 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: fe80::211:0000:0000:666b/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:297270516 errors:0 dropped:0 overruns:0 frame:0
TX packets:99779918 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:374413588608 (348.6 GiB) TX bytes:35989121637 (33.5 GiB)
ethtool eth4
Settings for eth4:
Supported ports: [ TP ]
Supported link modes: 100baseT/Full
1000baseT/Full
10000baseT/Full
Supported pause frame use: Symmetric
Supports auto-negotiation: Yes
Advertised link modes: 100baseT/Full
1000baseT/Full
10000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Speed: Unknown!
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: external
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: g
Wake-on: d
Link detected: no
ifconfig eth4 down
ifconfig eth4 up
#!/bin/sh
################################################################################
# Ethernet bridge for Synology v0.2
#
# notes:
# - let this script run on boot with root privileges
# - this script creates a bridge between LAN4 (eth3, 1G) and LAN5 (eth4, 10G)
# - the bridge gets the IP 192.168.178.12 (change it to your needs)
# - if LAN4 is not connected to a switch it skips bridge creation (fallback in case of troubles)
# - you need to set fixed IPs for LAN4 and LAN5 through DSM that are different from the bridge!
# - if you manually restart the script it will re-create the bridge (maybe useful for debugging purposes)
#
################################################################################
# Load the required kernel modules
insmod /lib/modules/stp.ko
insmod /lib/modules/bridge.ko
# remove bridge if it already exists
if ethtool br0 2>/dev/null | grep -q "Link detected: yes"; then
ifconfig br0 down
brctl delbr br0
echo "Already existing LAN-Bridge has been removed!"
fi
# stop if first ethernet port is disconnected (trouble fallback)
if ! ethtool eth3 2>/dev/null | grep -q "Link detected: yes"; then
echo "LAN-Bridge not created. The first bridge port is not connected!"
exit 1
fi
# add bridge
brctl addbr br0
brctl stp br0 off
# set bridge ip
ifconfig br0 192.168.178.12 netmask 255.255.255.0 up
# add ethernet ports to bridge
brctl addif br0 eth3
brctl addif br0 eth4
# process any network traffic
#ifconfig eth3 promisc up
#ifconfig eth4 promisc up
# set bridge mac address to eth4
#ip link set br0 address 00:00:00:00:00:6B
# add routes
route add -net 192.168.178.0 netmask 255.255.255.0 dev br0
route add default gw 192.168.178.1 dev br0
Netgear GS110EMX bestellt. 10 Gbit lagen aber diesmal nicht an. Bei dem Switch habe ich zwei 10 Gbit/s Ports
Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.
Als Dankeschön schalten wir deinen Account werbefrei.