updated on Sun Jan 8 12:02:35 UTC 2012
[aur-mirror.git] / sova / network2
blob37968d2c55f2eb0ad0aa506529c0df674b80218d
1 #!/bin/bash
3 # SOVA networking2 settings.
5 # WARNING! Remember to put '$true' in any function you intend to leave empty
6 # (e.g. you don't need to use the 'custom_variables' function)
7 # to make sure the script doesn't break.
9 binaries_paths()
11 ### get full paths
12 # the 'exit 0' binary
13 true="`which true`"
15 ip="`which ip`"
16 vcfg="`which vcfg`"
17 sv6="`which stripipv6`"
20 custom_variables()
22 # define whatever you need here
24 $true
27 start_networking()
29 ### loopback
30 #$ip addr add 127.0.0.1/8 dev lo broadcast + scope host
31 #$ip link set lo up
33 ### physical interfaces
34 # eth0
35 $ip addr add 192.168.10.10/24 dev eth0 broadcast +
36 $ip link set eth0 up
37 $sv6 eth0
39 ### 802.11q VLAN interfaces (see `vcfg -h' for help)
40 ## prepare vlan environment
41 $vcfg initialise
43 # vlan123 hosted by eth1
44 $vcfg add eth1 123 10.1.1.10/24
45 $vcfg add-addr 123 172.16.1.20/16
47 #vlan 15 hosted by eth1
48 $vcfg add eth1 15 10.9.9.9/24
49 $sv6 vlan15
51 ### default and static route(s)
52 $ip route add default via 192.168.10.1
55 stop_networking()
57 ### loopback
58 #$ip link set lo down
59 #$ip addr flush dev lo
61 ### physical interfaces
62 # eth0
63 $ip link set eth0 down
64 $ip addr flush dev eth0
66 ### 802.11q VLAN interfaces (see `vcfg -h' for help)
68 # remove VLANS
69 $vcfg rem-all
71 ### default and static route(s)
72 $ip route del default
75 # EOF