-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-v-lan.ksh
66 lines (52 loc) · 1.09 KB
/
setup-v-lan.ksh
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh
# Enumerate and select available Virtual Ethernet Adapters
clear
print "Available Virtual Ethernet adapter:"
for ent in `lsdev -Cc adapter -S A -t IBM,l-lan -F name`
do
print "\t ${ent}"
done
print "Enter your selection: \b\c"
read adapter
if [[ -z "${adapter}" ]]
then
adapter=ent0
fi
# setting chksum_offload
chdev -l ${adapter} -a chksum_offload=yes
# generate network interface name
num=`echo $adapter | sed 's/ent//'`
if=en${num}
hostname=''
ip=''
mask=''
gw=''
while [[ -z $hostname ]]
do
print "Enter hostname: \b\c"
read hostname
done
while [[ -z $ip ]]
do
print "Enter ip address: \b\c"
read ip
done
while [[ -z $mask ]]
do
print "Enter netmask: \b\c"
read mask
done
while [[ -z $gw ]]
do
print "Enter default gateway: \b\c"
read gw
done
mktcpip -h $hostname -a $ip -i $if -m $mask -g $gw
# setup if
chdev -l $if -a mtu_bypass=on
chdev -l $if -a mtu=9000
ifconfig $if mtu 9000
# TCP/IP Stack tuning
no -p -o tcp_sendspace=262144 -o tcp_recvspace=262144 \
-o udp_sendspace=65536 -o udp_recvspace=655360 \
-o tcp_nodelayack=0 -o rfc1323=1 -o sack=1