Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
P
playbooks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
playbooks
Commits
6c5aa00f
Commit
6c5aa00f
authored
Aug 20, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates
parent
a496a73c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
3 deletions
+28
-3
chnroute.yml
chnroute.yml
+20
-0
files/hypervisor/iptables-forward.sh
files/hypervisor/iptables-forward.sh
+8
-0
services.yml
services.yml
+0
-2
worker.yml
worker.yml
+0
-1
No files found.
chnroute.yml
0 → 100644
View file @
6c5aa00f
---
-
hosts
:
chnroute-reverse
remote_user
:
root
become
:
true
tasks
:
-
name
:
upload list
copy
:
src
:
'
../chnroute-reverse/chnroute-reverse.txt'
dest
:
'
{{ansible_user_dir}}/chnroute-reverse.txt'
owner
:
'
{{ansible_ssh_user}}'
group
:
'
{{ansible_ssh_user}}'
mode
:
0644
notify
:
reload_list
handlers
:
-
name
:
reload_list
shell
:
|
ipset create chnrouter hash:net maxelem 1000000 || true
ipset flush chnrouter
grep -P '^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)' {{ansible_user_dir}}/chnroute-reverse.txt | sort | uniq | xargs -I {} bash -c 'ipset add chnrouter {}'
true
files/hypervisor/iptables-forward.sh
View file @
6c5aa00f
#!/bin/bash
#!/bin/bash
sudo
iptables
-t
nat
-A
PREROUTING
-m
addrtype
--dst-type
LOCAL
-p
tcp
-m
multiport
--dports
$1
-j
DNAT
--to-destination
$2
sudo
iptables
-t
nat
-A
PREROUTING
-m
addrtype
--dst-type
LOCAL
-p
tcp
-m
multiport
--dports
$1
-j
DNAT
--to-destination
$2
sudo
iptables
-t
nat
-A
PREROUTING
-m
addrtype
--dst-type
LOCAL
-p
udp
-m
multiport
--dports
$1
-j
DNAT
--to-destination
$2
sudo
iptables
-t
nat
-A
PREROUTING
-m
addrtype
--dst-type
LOCAL
-p
udp
-m
multiport
--dports
$1
-j
DNAT
--to-destination
$2
cp
./ipt ./ipt.bak
cp
./ipt ./ipt.bak
sudo
iptables-save
>
./ipt
sudo
iptables-save
>
./ipt
echo
"# use iptables-restore --noflush"
>
~/iptables-gateways
echo
"*nat"
>>
~/iptables-gateways
echo
":PREROUTING -"
>>
~/iptables-gateways
sudo
iptables
-t
nat
-S
PREROUTING |
grep
--
"-j DNAT"
>>
~/iptables-gateways
echo
"COMMIT"
>>
~/iptables-gateways
#netfilter-persistent save
#netfilter-persistent save
services.yml
View file @
6c5aa00f
...
@@ -21,8 +21,6 @@
...
@@ -21,8 +21,6 @@
verify_host
:
no
verify_host
:
no
checksum
:
yes
checksum
:
yes
archive
:
no
archive
:
no
owner
:
yes
group
:
yes
perms
:
yes
perms
:
yes
-
name
:
templates directory
-
name
:
templates directory
file
:
file
:
...
...
worker.yml
View file @
6c5aa00f
...
@@ -24,7 +24,6 @@
...
@@ -24,7 +24,6 @@
pip
:
pip
:
name
:
ansible,awscli
name
:
ansible,awscli
state
:
latest
state
:
latest
extra_args
:
-i https://mirrors.aliyun.com/pypi/simple/
-
name
:
ansible
-
name
:
ansible
synchronize
:
synchronize
:
src
:
~/ansible/
src
:
~/ansible/
...
...
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