Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sshuttle
Project
Project
Details
Activity
Releases
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pub
sshuttle
Commits
f84b87d7
Commit
f84b87d7
authored
May 01, 2010
by
Avery Pennarun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ipt: example script for how to set up an iptables transproxy.
parent
2f3c86e9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
ipt
ipt
+28
-0
No files found.
ipt
0 → 100755
View file @
f84b87d7
#!/bin/bash -x
PORT
=
"
$1
"
shift
if
[
-z
"
$PORT
"
]
||
!
[
"
$PORT
"
-gt
0
]
;
then
echo
"'
$PORT
' is not a valid port number"
exit
1
fi
# basic cleanup/setup
C
=
sshuttle-
$PORT
iptables
-t
nat
-D
OUTPUT
-j
$C
iptables
-t
nat
-F
$C
iptables
-t
nat
-X
$C
if
[
-z
"
$*
"
]
;
then
# just delete existing rules
exit
0
fi
iptables
-t
nat
-N
$C
iptables
-t
nat
-I
OUTPUT 1
-j
$C
iptables
-t
nat
-D
$C
-j
REDIRECT
-p
tcp
--to-ports
$PORT
# create new subnet entries
for
subnet
in
"
$@
"
;
do
iptables
-t
nat
-A
$C
-j
REDIRECT
--dest
"
$subnet
"
-p
tcp
\
--to-ports
"
$PORT
"
done
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