質問編集履歴
6
誤記修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -84,9 +84,9 @@
|
|
84
84
|
|
85
85
|
#SSH
|
86
86
|
|
87
|
-
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
|
87
|
+
iptables -A INPUT -p tcp --dport 10022 -j ACCEPT
|
88
|
-
|
88
|
+
|
89
|
-
iptables -A INPUT -p tcp --sport 22 -j ACCEPT
|
89
|
+
iptables -A INPUT -p tcp --sport 10022 -j ACCEPT
|
90
90
|
|
91
91
|
|
92
92
|
|
5
誤記修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -136,7 +136,7 @@
|
|
136
136
|
|
137
137
|
**<停止させたデーモン>**
|
138
138
|
|
139
|
-
「dns-clean」「grub-common」「ondemand」「pppd-dns」「r
|
139
|
+
「dns-clean」「grub-common」「ondemand」「pppd-dns」「rsync」
|
140
140
|
|
141
141
|
|
142
142
|
|
4
微修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -200,7 +200,7 @@
|
|
200
200
|
|
201
201
|
###【参考にしたサイト】
|
202
202
|
|
203
|
-
【iptables】TeamSpeak3向けのiptables設定 VPS版
|
203
|
+
【iptables】TeamSpeak3向けのiptables設定 VPS版(英語フォーラム)
|
204
204
|
|
205
205
|
[http://forum.teamspeak.com/threads/108259-iptables-rules](http://forum.teamspeak.com/threads/108259-iptables-rules)
|
206
206
|
|
3
文章を整理
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,10 +1,178 @@
|
|
1
1
|
###【解決したい問題】
|
2
2
|
|
3
|
-
TeamSpeak3をさくらVPSのUbuntuサーバーに導入したいのですが、
|
3
|
+
TeamSpeak3をさくらVPSのUbuntuサーバーに導入したいのですが、
|
4
|
+
|
5
|
+
参考サイト等を基にiptablesを設定しても上手く通信を確立できません。
|
4
6
|
|
5
7
|
適切なiptablesの設定を教えてください。よろしくお願いします。
|
6
8
|
|
9
|
+
|
10
|
+
|
7
|
-
※iptables抜きでの導入は全て完了しています。
|
11
|
+
※iptables抜きでのTeamSpeak3導入と動作確認までは全て完了しています。
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
###【質問までの流れ】
|
16
|
+
|
17
|
+
1. さくらVPS、Ubuntu server、TeamSpeak3サーバーは、いずれも初利用
|
18
|
+
|
19
|
+
2. Ubuntuサーバーの初期設定(iptables除く)とTeamSpeak3の導入は成功
|
20
|
+
|
21
|
+
3. iptablesを設定した段階で、TeamSpeak3サーバーへの接続がクライアントからできなくなる
|
22
|
+
|
23
|
+
4. 各サイト(文末に記載)を参考にあれこれ試し、ごちゃごちゃになって原因が特定できずOSごと再インストールを何度か繰り返す
|
24
|
+
|
25
|
+
5. OSインストールと初期設定、TeamSpeak3導入完了の状態で一度質問してみよう(今ここ)
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
###【iptablesの設定】
|
30
|
+
|
31
|
+
※#は、質問文記載の為に全角に置き換えたもの
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
/etc/profile.d/iptables_set.sh
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
#flush
|
40
|
+
|
41
|
+
iptables -t nat -F
|
42
|
+
|
43
|
+
iptables -t nat -X
|
44
|
+
|
45
|
+
iptables -t mangle -F
|
46
|
+
|
47
|
+
iptables -t mangle -X
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
#Teamspeak
|
52
|
+
|
53
|
+
iptables -A INPUT -p udp --dport 9987 -j ACCEPT
|
54
|
+
|
55
|
+
iptables -A INPUT -p udp --sport 9987 -j ACCEPT
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
iptables -A INPUT -p tcp --dport 30033 -j ACCEPT
|
60
|
+
|
61
|
+
iptables -A INPUT -p tcp --sport 30033 -j ACCEPT
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
iptables -A INPUT -p tcp --dport 10011 -j ACCEPT
|
66
|
+
|
67
|
+
iptables -A INPUT -p tcp --sport 10011 -j ACCEPT
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
#HTTP(s)
|
72
|
+
|
73
|
+
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
74
|
+
|
75
|
+
iptables -A INPUT -p tcp --sport 80 -j ACCEPT
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
|
80
|
+
|
81
|
+
iptables -A INPUT -p tcp --sport 443 -j ACCEPT
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
#SSH
|
86
|
+
|
87
|
+
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
|
88
|
+
|
89
|
+
iptables -A INPUT -p tcp --sport 22 -j ACCEPT
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
#DNS
|
94
|
+
|
95
|
+
iptables -A INPUT -p udp --dport 53 -j ACCEPT
|
96
|
+
|
97
|
+
iptables -A INPUT -p udp --sport 53 -j ACCEPT
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
#SECURE
|
102
|
+
|
103
|
+
iptables -P INPUT DROP
|
104
|
+
|
105
|
+
iptables -P FORWARD DROP
|
106
|
+
|
107
|
+
iptables -P OUTPUT ACCEPT
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
service iptables save
|
112
|
+
|
113
|
+
service iptables restart
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
###【構成】
|
118
|
+
|
119
|
+
**<ユーザー>**
|
120
|
+
|
121
|
+
root : iptablesの設定ファイルを/etc/profile.d/iptables_set.shで保持
|
122
|
+
|
123
|
+
管理用ユーザー : ログインと各種操作用
|
124
|
+
|
125
|
+
TeamSpeakユーザー : homeディレクトリにTeamSpeak3のパッケージを保持、sudo権限なし
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
**<インストール済みパッケージ>**
|
130
|
+
|
131
|
+
「vim」「sysv-rc-conf」「iptables」(rootで導入)
|
132
|
+
|
133
|
+
日本語化は未導入
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
**<停止させたデーモン>**
|
138
|
+
|
139
|
+
「dns-clean」「grub-common」「ondemand」「pppd-dns」「rc.local」「rsync」
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
**<停止させたコンソール>**
|
144
|
+
|
145
|
+
/etc/init/tty2.conf ~ tty6.conf まで停止中
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
**<SSHの設定>**
|
150
|
+
|
151
|
+
/etc/ssh/sshd_config
|
152
|
+
|
153
|
+
#ポート番号を 22 (デフォルト)から10022へ変更する
|
154
|
+
|
155
|
+
Port 10022
|
156
|
+
|
157
|
+
#SSHのプロトコルをSSH2のみ対応とする
|
158
|
+
|
159
|
+
Protocol 2
|
160
|
+
|
161
|
+
#rootでのログインを不可とする
|
162
|
+
|
163
|
+
PermitRootLogin no
|
164
|
+
|
165
|
+
#パスワードでのログインを許可する
|
166
|
+
|
167
|
+
PasswordAuthentication yes
|
168
|
+
|
169
|
+
#パスワードなしでのログインを不可とする
|
170
|
+
|
171
|
+
PermitEmptyPasswords no
|
172
|
+
|
173
|
+
#管理用ユーザだけログインを許可する
|
174
|
+
|
175
|
+
AllowUsers 管理用ユーザー名
|
8
176
|
|
9
177
|
|
10
178
|
|
@@ -30,172 +198,32 @@
|
|
30
198
|
|
31
199
|
|
32
200
|
|
33
|
-
###【
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
Port 10022
|
50
|
-
|
51
|
-
# SSHのプロトコルをSSH2のみ対応とする
|
52
|
-
|
53
|
-
Protocol 2
|
54
|
-
|
55
|
-
# rootでのログインを不可とする
|
56
|
-
|
57
|
-
PermitRootLogin no
|
58
|
-
|
59
|
-
# パスワードでのログインを許可する
|
60
|
-
|
61
|
-
PasswordAuthentication yes
|
62
|
-
|
63
|
-
# パスワードなしでのログインを不可とする
|
64
|
-
|
65
|
-
PermitEmptyPasswords no
|
66
|
-
|
67
|
-
# 管理用ユーザだけログインを許可する
|
68
|
-
|
69
|
-
AllowUsers 管理用ユーザー名
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
**3.以下のデーモンを停止**
|
74
|
-
|
75
|
-
dns-clean
|
76
|
-
|
77
|
-
grub-common
|
78
|
-
|
79
|
-
ondemand
|
80
|
-
|
81
|
-
pppd-dns
|
82
|
-
|
83
|
-
rc.local
|
84
|
-
|
85
|
-
rsync
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
**4.以下のコンソールを停止**
|
90
|
-
|
91
|
-
/etc/init/tty2.conf
|
92
|
-
|
93
|
-
/etc/init/tty3.conf
|
94
|
-
|
95
|
-
/etc/init/tty4.conf
|
96
|
-
|
97
|
-
/etc/init/tty5.conf
|
98
|
-
|
99
|
-
/etc/init/tty6.conf
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
**5.TeamSpeak3管理用ユーザー(非sudo権限)を作成し、homeディレクトリでTeamSpeak3をwgetし、以降は下記URLのガイドを参考に
|
201
|
+
###【参考にしたサイト】
|
202
|
+
|
203
|
+
【iptables】TeamSpeak3向けのiptables設定 VPS版
|
204
|
+
|
205
|
+
[http://forum.teamspeak.com/threads/108259-iptables-rules](http://forum.teamspeak.com/threads/108259-iptables-rules)
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
【基本設定】評判のさくらのVPSを使うときに最初にやっておきたいこと(Ubuntu編)
|
210
|
+
|
211
|
+
[http://server-setting.info/ubuntu/first-setting-ubuntu-server.html](http://server-setting.info/ubuntu/first-setting-ubuntu-server.html)
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
【TeamSpeak3の導入】TS3 wiki サーバ/Linux
|
104
216
|
|
105
217
|
[http://hovel.arcenserv.info/ts3/?%E3%82%B5%E3%83%BC%E3%83%90%2FLinux](http://hovel.arcenserv.info/ts3/?%E3%82%B5%E3%83%BC%E3%83%90%2FLinux)
|
106
218
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
[http://
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
行ったiptables設定内容
|
122
|
-
|
123
|
-
/etc/profile.d/iptables_set.sh
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
# flush
|
128
|
-
|
129
|
-
iptables -t nat -F
|
130
|
-
|
131
|
-
iptables -t nat -X
|
132
|
-
|
133
|
-
iptables -t mangle -F
|
134
|
-
|
135
|
-
iptables -t mangle -X
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
# Teamspeak
|
140
|
-
|
141
|
-
iptables -A INPUT -p udp --dport 9987 -j ACCEPT
|
142
|
-
|
143
|
-
iptables -A INPUT -p udp --sport 9987 -j ACCEPT
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
iptables -A INPUT -p tcp --dport 30033 -j ACCEPT
|
148
|
-
|
149
|
-
iptables -A INPUT -p tcp --sport 30033 -j ACCEPT
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
iptables -A INPUT -p tcp --dport 10011 -j ACCEPT
|
154
|
-
|
155
|
-
iptables -A INPUT -p tcp --sport 10011 -j ACCEPT
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
# HTTP(s)
|
160
|
-
|
161
|
-
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
162
|
-
|
163
|
-
iptables -A INPUT -p tcp --sport 80 -j ACCEPT
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
|
168
|
-
|
169
|
-
iptables -A INPUT -p tcp --sport 443 -j ACCEPT
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
# SSH
|
174
|
-
|
175
|
-
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
|
176
|
-
|
177
|
-
iptables -A INPUT -p tcp --sport 22 -j ACCEPT
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
# DNS
|
182
|
-
|
183
|
-
iptables -A INPUT -p udp --dport 53 -j ACCEPT
|
184
|
-
|
185
|
-
iptables -A INPUT -p udp --sport 53 -j ACCEPT
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
#SECURE
|
190
|
-
|
191
|
-
iptables -P INPUT DROP
|
192
|
-
|
193
|
-
iptables -P FORWARD DROP
|
194
|
-
|
195
|
-
iptables -P OUTPUT ACCEPT
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
service iptables save
|
200
|
-
|
201
|
-
service iptables restart
|
219
|
+
|
220
|
+
|
221
|
+
【さくらVPS公式】iptablesの設定
|
222
|
+
|
223
|
+
[https://help.sakura.ad.jp/app/answers/detail/a_id/2423/~/iptables%E3%81%AE%E8%A8%AD%E5%AE%9A%E6%96%B9%E6%B3%95](https://help.sakura.ad.jp/app/answers/detail/a_id/2423/~/iptables%E3%81%AE%E8%A8%AD%E5%AE%9A%E6%96%B9%E6%B3%95)
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
【TS3 iptables設定例】備忘録: [CentOS] TeamSpeak 3 サーバー構築
|
228
|
+
|
229
|
+
[http://tsubasa3611.blog130.fc2.com/blog-entry-169.html](http://tsubasa3611.blog130.fc2.com/blog-entry-169.html)
|
2
iptables設定の記載
test
CHANGED
File without changes
|
test
CHANGED
@@ -112,16 +112,90 @@
|
|
112
112
|
|
113
113
|
**6.iptablesの設定(ここでトラブル)**
|
114
114
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
115
|
+
下記フォーラムを参考にiptablesの設定を行い、TeamSpeak3クライアントからサーバーへの接続ができなくなりました。
|
116
|
+
|
117
|
+
[http://forum.teamspeak.com/threads/108259-iptables-rules](http://forum.teamspeak.com/threads/108259-iptables-rules)
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
行ったiptables設定内容
|
122
|
+
|
123
|
+
/etc/profile.d/iptables_set.sh
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
# flush
|
128
|
+
|
129
|
+
iptables -t nat -F
|
130
|
+
|
131
|
+
iptables -t nat -X
|
132
|
+
|
133
|
+
iptables -t mangle -F
|
134
|
+
|
135
|
+
iptables -t mangle -X
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
# Teamspeak
|
140
|
+
|
141
|
+
iptables -A INPUT -p udp --dport 9987 -j ACCEPT
|
142
|
+
|
143
|
+
iptables -A INPUT -p udp --sport 9987 -j ACCEPT
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
iptables -A INPUT -p tcp --dport 30033 -j ACCEPT
|
148
|
+
|
149
|
+
iptables -A INPUT -p tcp --sport 30033 -j ACCEPT
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
iptables -A INPUT -p tcp --dport 10011 -j ACCEPT
|
154
|
+
|
155
|
+
iptables -A INPUT -p tcp --sport 10011 -j ACCEPT
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
# HTTP(s)
|
160
|
+
|
161
|
+
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
162
|
+
|
163
|
+
iptables -A INPUT -p tcp --sport 80 -j ACCEPT
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
|
168
|
+
|
169
|
+
iptables -A INPUT -p tcp --sport 443 -j ACCEPT
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
# SSH
|
174
|
+
|
175
|
+
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
|
176
|
+
|
177
|
+
iptables -A INPUT -p tcp --sport 22 -j ACCEPT
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
# DNS
|
182
|
+
|
183
|
+
iptables -A INPUT -p udp --dport 53 -j ACCEPT
|
184
|
+
|
185
|
+
iptables -A INPUT -p udp --sport 53 -j ACCEPT
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
#SECURE
|
190
|
+
|
191
|
+
iptables -P INPUT DROP
|
192
|
+
|
193
|
+
iptables -P FORWARD DROP
|
194
|
+
|
195
|
+
iptables -P OUTPUT ACCEPT
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
service iptables save
|
200
|
+
|
201
|
+
service iptables restart
|
1
サーバーへの接続失敗について補足
test
CHANGED
File without changes
|
test
CHANGED
@@ -112,7 +112,7 @@
|
|
112
112
|
|
113
113
|
**6.iptablesの設定(ここでトラブル)**
|
114
114
|
|
115
|
-
長文になるのでリンクのみとさせていただきますが、下記サイトを参考にiptablesの設定を行い、サーバーへの接続ができなくなりました。
|
115
|
+
長文になるのでリンクのみとさせていただきますが、下記サイトを参考にiptablesの設定を行い、TeamSpeak3クライアントからサーバーへの接続ができなくなりました。
|
116
116
|
|
117
117
|
|
118
118
|
|