Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
48217865
Commit
48217865
authored
Mar 15, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit route scripts
parent
4d5a9d8f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
5 deletions
+32
-5
both_provs.sh
router/both_provs.sh
+14
-0
check_connectivity.sh
router/check_connectivity.sh
+3
-2
only_ekvant.sh
router/only_ekvant.sh
+4
-0
only_prometey.sh
router/only_prometey.sh
+5
-0
update_z-i.sh
router/update_z-i.sh
+6
-3
No files found.
router/both_provs.sh
View file @
48217865
...
...
@@ -13,6 +13,15 @@ ip rule del from 91.232.225.21 lookup hop
ip rule del from 91.232.225.21 lookup hop
ip rule add from 91.232.225.21 lookup hop
# output from prometey to prometey
ip rule add from all fwmark 0x4 lookup prometey
# stog server
#ip rule del from 91.232.225.41 && ip rule del from 91.232.225.41
#ip rule add from 91.232.225.41 lookup prometey
ip rule del from 91.232.225.41
&&
ip rule del from 91.232.225.41
ip rule add from 91.232.225.41 lookup hop
# 91.232.225.60-69 lazy-kun
ip rule del from 91.232.225.62
&&
ip rule del from 91.232.225.62
ip rule add from 91.232.225.62 lookup prometey
...
...
@@ -22,6 +31,11 @@ ip rule del to 144.76.183.114 lookup hop
ip rule del to 144.76.183.114 lookup hop
ip rule add to 144.76.183.114 lookup hop
# a01
ip rule del to 136.243.107.44 lookup hop
ip rule del to 136.243.107.44 lookup hop
ip rule add to 136.243.107.44 lookup hop
# telros
ip rule del to 85.143.133.46 lookup hop
ip rule del to 85.143.133.46 lookup hop
...
...
router/check_connectivity.sh
View file @
48217865
...
...
@@ -7,7 +7,8 @@ write_log()
if
[
-n
"
$FOREGROUND
"
]
;
then
echo
"
$*
"
else
echo
"
$*
"
|
tee
-a
/var/log/check_connectivity.log | mail
-s
"Etersoft router state is changed"
vitaly.lipatov@gmail.com
echo
"
$*
"
|
tee
-a
/var/log/check_connectivity.log
# | mail -s "Etersoft router state is changed" vitaly.lipatov@gmail.com
fi
}
...
...
@@ -144,7 +145,7 @@ torrent_control()
CURDISCOUNT
=
$((
$CURDISCOUNT
-
1
))
fi
#
dis
able alt speed on heavy load or overload
#
en
able alt speed on heavy load or overload
if
[
"
$AVERAGE
"
-gt
$MAXAVERAGE
]
||
[
"
$TX_INET
"
-gt
$MAXTX
]
;
then
ALTSPEED
=
1
CURDISCOUNT
=
0
...
...
router/only_ekvant.sh
View file @
48217865
...
...
@@ -8,6 +8,10 @@ ip route replace default scope global table common via 212.176.192.226
ip route replace default scope global table hop via 212.176.192.226
# stog server
#ip rule del from 91.232.225.41 && ip rule del from 91.232.225.41
#ip rule add from 91.232.225.41 lookup ekvant
# 91.232.225.60-69 lazy-kun
ip rule del from 91.232.225.62
&&
ip rule del from 91.232.225.62
ip rule add from 91.232.225.62 lookup ekvant
...
...
router/only_prometey.sh
View file @
48217865
...
...
@@ -12,6 +12,11 @@ ip route replace default scope global table hop via 85.235.198.25
ip rule del from 91.232.225.62
&&
ip rule del from 91.232.225.62
ip rule add from 91.232.225.62 lookup prometey
# stog server
#ip rule del from 91.232.225.41 && ip rule del from 91.232.225.41
#ip rule add from 91.232.225.41 lookup prometey
# replace source for ns4 when we have no Ekvant
iptables
-t
nat
-A
POSTROUTING
-o
inet2
-s
212.176.200.18
-j
SNAT
--to-source
91.232.225.1
...
...
router/update_z-i.sh
View file @
48217865
...
...
@@ -4,12 +4,14 @@ cd $(dirname $0) || exit
SETNAME
=
rkz
ipset destroy
$SETNAME
.tmp
ipset create
$SETNAME
hash
:ip 2>/dev/null
ipset create
$SETNAME
.tmp
hash
:ip
||
exit
#ip rule show | grep "lookup openroute" | sed -e "s|.*:||g" | sed -e "s|lookup|table|g" | while read str ; do
#done
./get_ips_z-i.sh |
while
read
ip
;
do
ssh
-q
192.168.1.217
-l
xoxo|
grep
-v
"Last login"
|
sed
$'s/
\r
//'
|
while
read
ip
;
do
#./get_ips_z-i.sh |while read ip ; do
#ip rule add to $ip table openroute
ipset add
$SETNAME
.tmp
$ip
done
...
...
@@ -19,6 +21,7 @@ ipset swap $SETNAME.tmp $SETNAME
# initial
if
!
iptables
-L
-t
mangle |
grep
-q
$SETNAME
;
then
iptables
-t
mangle
-A
PREROUTING
-i
our
-m
set
--match-set
$SETNAME
dst
-j
MARK
--set-mark
5
ip rule add fwmark 5 table openroute
ip route replace default table openroute scope global nexthop dev tun0
||
exit
iptables
-t
mangle
-A
PREROUTING
-i
our
-m
set
--match-set
$SETNAME
dst
-j
MARK
--set-mark
5
||
exit
ip rule add fwmark 5 table openroute
||
exit
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment