developer | 42af00d | 2022-08-29 18:59:45 +0800 | [diff] [blame] | 1 | #!/bin/sh |
developer | 139ca35 | 2022-11-23 17:45:23 +0800 | [diff] [blame] | 2 | lan_ip=`syscfg get lan_ipaddr` |
| 3 | lan_mask=`syscfg get lan_netmask` |
developer | 42af00d | 2022-08-29 18:59:45 +0800 | [diff] [blame] | 4 | #Setting brlan0 bridge |
| 5 | if [ ! -d /sys/class/net/brlan0 ] |
| 6 | then |
| 7 | brctl addbr brlan0 |
| 8 | ip link set brlan0 address `cat /sys/class/net/eth1/address` |
developer | 139ca35 | 2022-11-23 17:45:23 +0800 | [diff] [blame] | 9 | ifconfig brlan0 $lan_ip netmask $lan_mask up |
developer | 42af00d | 2022-08-29 18:59:45 +0800 | [diff] [blame] | 10 | fi |
| 11 | |
| 12 | #Work around for Ethernet connected clients |
| 13 | if [ ! -d /sys/class/net/lan0 ] |
| 14 | then |
| 15 | brctl addif brlan0 eth1 |
| 16 | else |
| 17 | brctl addif brlan0 lan0 |
| 18 | brctl addif brlan0 lan1 |
| 19 | brctl addif brlan0 lan2 |
| 20 | brctl addif brlan0 lan3 |
| 21 | brctl addif brlan0 lan4 |
developer | 158c9ee | 2022-10-24 16:43:53 +0800 | [diff] [blame] | 22 | brctl addif brlan0 lan5 |
developer | 42af00d | 2022-08-29 18:59:45 +0800 | [diff] [blame] | 23 | |
| 24 | ifconfig lan0 up |
| 25 | ifconfig lan1 up |
| 26 | ifconfig lan2 up |
| 27 | ifconfig lan3 up |
| 28 | ifconfig lan4 up |
developer | 158c9ee | 2022-10-24 16:43:53 +0800 | [diff] [blame] | 29 | ifconfig lan5 up |
developer | 42af00d | 2022-08-29 18:59:45 +0800 | [diff] [blame] | 30 | fi |
| 31 | ifconfig eth1 up |
| 32 | |
developer | 139ca35 | 2022-11-23 17:45:23 +0800 | [diff] [blame] | 33 | board_name=`cat /proc/device-tree/model` |
developer | 42af00d | 2022-08-29 18:59:45 +0800 | [diff] [blame] | 34 | |
developer | 139ca35 | 2022-11-23 17:45:23 +0800 | [diff] [blame] | 35 | if [[ $board_name == *"7988"* ]]; then |
| 36 | brctl addif brlan0 eth3 |
| 37 | ifconfig eth3 up |
| 38 | fi |
developer | 42af00d | 2022-08-29 18:59:45 +0800 | [diff] [blame] | 39 | #workaround: creating /opt/secure folder for ssh service |
| 40 | if [ ! -d /opt/secure ]; then |
developer | 139ca35 | 2022-11-23 17:45:23 +0800 | [diff] [blame] | 41 | mkdir -p /opt/secure |
developer | 42af00d | 2022-08-29 18:59:45 +0800 | [diff] [blame] | 42 | fi |