start.sh
· 544 B · Bash
Originalformat
#!/bin/bash
modprobe usbnet
ifconfig eth0 10.0.5.149 netmask 255.255.255.0
ifconfig usb0 192.168.42.127 netmask 255.255.255.0
ip rule add from 10.0.5.149 table 1
ip rule add from 192.168.42.127 table 2
ip route add 10.0.5.0/24 dev eth0 scope link table 1
ip route add default via 10.0.5.5 dev eth0 table 1
ip route add 192.168.42.0/24 dev usb0 scope link table 2
ip route add default via 192.168.42.129 dev usb0 table 2
ip route add default scope global nexthop via 192.168.42.129 dev usb0
echo "nameserver 8.8.8.8" > /etc/resolv.conf
| 1 | #!/bin/bash |
| 2 | |
| 3 | modprobe usbnet |
| 4 | |
| 5 | ifconfig eth0 10.0.5.149 netmask 255.255.255.0 |
| 6 | ifconfig usb0 192.168.42.127 netmask 255.255.255.0 |
| 7 | |
| 8 | ip rule add from 10.0.5.149 table 1 |
| 9 | ip rule add from 192.168.42.127 table 2 |
| 10 | |
| 11 | ip route add 10.0.5.0/24 dev eth0 scope link table 1 |
| 12 | ip route add default via 10.0.5.5 dev eth0 table 1 |
| 13 | |
| 14 | |
| 15 | ip route add 192.168.42.0/24 dev usb0 scope link table 2 |
| 16 | ip route add default via 192.168.42.129 dev usb0 table 2 |
| 17 | |
| 18 | ip route add default scope global nexthop via 192.168.42.129 dev usb0 |
| 19 | |
| 20 | |
| 21 | echo "nameserver 8.8.8.8" > /etc/resolv.conf |
| 22 |