File: network

package info (click to toggle)
sysvinit 2.84-2woody1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 652 kB
  • ctags: 463
  • sloc: ansic: 5,282; sh: 1,193; perl: 158; makefile: 156
file content (27 lines) | stat: -rw-r--r-- 775 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! /bin/sh
#
# network	Establish the network connection.
#
# Version:	@(#)network  2.2  19-Apr-1999 miquels@cistron.nl
#

case "`uname -r`" in
        2.0.*) ADDROUTE="yes" ;;
        *)     ADDROUTE="" ;;
esac

# Configure the loopback device.
ifconfig lo 127.0.0.1
[ "$ADDROUTE" ] && route add -net 127.0.0.0 dev lo

# Configure the ethernet device or start SLIP/PPP below.
IPADDR="192.168.1.1"		# Your IP address.
NETMASK="255.255.255.0"		# Your netmask.
NETWORK="192.168.1.0"		# Your network address.
BROADCAST="192.168.1.255"	# Your broadcast address (blank if none).
GATEWAY=""			# Your gateway address.

ifconfig eth0 ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
[ "$ADDROUTE" ] && route add -net ${NETWORK}
[ "$GATEWAY" ]  && route add default gw ${GATEWAY}