Changes between Initial Version and Version 1 of waue/2010/1130


Ignore:
Timestamp:
Nov 30, 2010, 5:14:18 PM (13 years ago)
Author:
waue
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • waue/2010/1130

    v1 v1  
     1
     2 * /etc/init.d/twocard
     3
     4{{{
     5#!sh
     6#! /bin/sh
     7### BEGIN INIT INFO
     8# Provides: single
     9# Required-Start: $local_fs $all killprocs
     10# Required-Stop:
     11# Default-Start: 1
     12# Default-Stop:
     13# Short-Description: executed by init(8) upon entering runlevel 1 (single).
     14### END INIT INFO
     15
     16PATH=/sbin:/bin
     17
     18do_start () {
     19log_action_msg "Two Card Mode ... go"
     20sh /etc/network/my_bi_ip.sh
     21}
     22
     23case "$1" in
     24start)
     25do_start
     26;;
     27restart|reload|force-reload)
     28echo "Error: argument '$1' not supported" >&2
     29exit 3
     30;;
     31stop)
     32# No-op
     33;;
     34*)
     35echo "Usage: $0 start|stop" >&2
     36exit 3
     37;;
     38esac
     39
     40}}}
     41
     42 * /etc/network/my_bi_ip.sh
     43
     44{{{
     45#!sh
     46#!/bin/bash
     47
     48IF1=eth1
     49IP1=140.110.138.193
     50NT1=140.110.138.0/24
     51GW1=140.110.138.254
     52
     53IF2=eth2
     54IP2=140.110.134.160
     55NT2=140.110.134.0/24
     56GW2=140.110.134.254
     57
     58DGW=${GW1}
     59
     60ip route add ${NT1} dev ${IF1} src ${IP1} table T1
     61ip route add default via ${GW1} table T1
     62
     63ip route add ${NT2} dev ${IF2} src ${IP2} table T2
     64ip route add default via ${GW2} table T2
     65
     66ip route add ${NT1} dev ${IF1} src ${IP1}
     67ip route add ${NT2} dev ${IF2} src ${IP2}
     68
     69ip route add default via ${DGW}
     70
     71ip rule add from ${NT1} table T1
     72ip rule add from ${NT2} table T2
     73
     74}}}