File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ IFCONFIG=" /sbin/ifconfig"
4+ INTERFACES=" /etc/network/interfaces"
5+
6+ IFACE=$( lshw -c network | grep " logical name" | awk ' {print $3; exit}' )
7+ ADDRESS=$( hostname -I | cut -d ' ' -f 1)
8+ NETMASK=$( $IFCONFIG | grep -w inet | grep -v 127.0.0.1| awk ' {print $4}' | cut -d " :" -f 2)
9+ GATEWAY=$( route -n| grep " UG" | grep -v " UGH" | cut -f 10 -d " " )
10+
11+ cat << -IPCONFIG > "$INTERFACES "
12+ source /etc/network/interfaces.d/*
13+ # The loopback network interface
14+ auto lo $IFACE
15+ iface lo inet loopback
16+ # The primary network interface
17+ iface $IFACE inet static
18+ pre-up /sbin/ethtool -K $IFACE tso off
19+ pre-up /sbin/ethtool -K $IFACE gso off
20+ # Fixes https://github.com/nextcloud/vm/issues/92:
21+ pre-up ip link set dev $IFACE mtu 1430
22+ # Best practice is to change the static address
23+ # to something outside your DHCP range.
24+ address $ADDRESS
25+ netmask $NETMASK
26+ gateway $GATEWAY
27+ # This is an autoconfigured IPv6 interface
28+ # iface $IFACE inet6 auto
29+ # Exit and save: [CTRL+X] + [Y] + [ENTER]
30+ # Exit without saving: [CTRL+X]
31+ IPCONFIG
32+
33+ exit 0
You can’t perform that action at this time.
0 commit comments