質問編集履歴
6
誤記修正
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
iptables -A INPUT -p tcp --sport 443 -j ACCEPT
|
|
42
42
|
|
|
43
43
|
#SSH
|
|
44
|
-
iptables -A INPUT -p tcp --dport
|
|
44
|
+
iptables -A INPUT -p tcp --dport 10022 -j ACCEPT
|
|
45
|
-
iptables -A INPUT -p tcp --sport
|
|
45
|
+
iptables -A INPUT -p tcp --sport 10022 -j ACCEPT
|
|
46
46
|
|
|
47
47
|
#DNS
|
|
48
48
|
iptables -A INPUT -p udp --dport 53 -j ACCEPT
|
5
誤記修正
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
日本語化は未導入
|
|
68
68
|
|
|
69
69
|
**<停止させたデーモン>**
|
|
70
|
-
「dns-clean」「grub-common」「ondemand」「pppd-dns」「
|
|
70
|
+
「dns-clean」「grub-common」「ondemand」「pppd-dns」「rsync」
|
|
71
71
|
|
|
72
72
|
**<停止させたコンソール>**
|
|
73
73
|
/etc/init/tty2.conf ~ tty6.conf まで停止中
|
4
微修正
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
※実際にwgetしたTeamSpeak3サーバー用ファイル(Linux 64bit用)
|
|
100
100
|
|
|
101
101
|
###【参考にしたサイト】
|
|
102
|
-
【iptables】TeamSpeak3向けのiptables設定 VPS版
|
|
102
|
+
【iptables】TeamSpeak3向けのiptables設定 VPS版(英語フォーラム)
|
|
103
103
|
[http://forum.teamspeak.com/threads/108259-iptables-rules](http://forum.teamspeak.com/threads/108259-iptables-rules)
|
|
104
104
|
|
|
105
105
|
【基本設定】評判のさくらのVPSを使うときに最初にやっておきたいこと(Ubuntu編)
|
3
文章を整理
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -1,73 +1,29 @@
|
|
|
1
1
|
###【解決したい問題】
|
|
2
|
-
TeamSpeak3をさくらVPSのUbuntuサーバーに導入したいのですが、
|
|
2
|
+
TeamSpeak3をさくらVPSのUbuntuサーバーに導入したいのですが、
|
|
3
|
+
参考サイト等を基にiptablesを設定しても上手く通信を確立できません。
|
|
3
4
|
適切なiptablesの設定を教えてください。よろしくお願いします。
|
|
4
|
-
※iptables抜きでの導入は全て完了しています。
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
サーバーOS:Ubuntu server 14.04 - 64bit (新規インストール)
|
|
8
|
-
[https://help.sakura.ad.jp/app/answers/detail/a_id/2403/~/%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0os%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%82%AC%E3%82%A4%E3%83%89---ubuntu-12.04%2F14.04](https://help.sakura.ad.jp/app/answers/detail/a_id/2403/~/%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0os%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%82%AC%E3%82%A4%E3%83%89---ubuntu-12.04%2F14.04)
|
|
6
|
+
※iptables抜きでのTeamSpeak3導入と動作確認までは全て完了しています。
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
###【質問までの流れ】
|
|
9
|
+
1. さくらVPS、Ubuntu server、TeamSpeak3サーバーは、いずれも初利用
|
|
10
|
+
2. Ubuntuサーバーの初期設定(iptables除く)とTeamSpeak3の導入は成功
|
|
11
|
+
3. iptablesを設定した段階で、TeamSpeak3サーバーへの接続がクライアントからできなくなる
|
|
11
|
-
|
|
12
|
+
4. 各サイト(文末に記載)を参考にあれこれ試し、ごちゃごちゃになって原因が特定できずOSごと再インストールを何度か繰り返す
|
|
13
|
+
5. OSインストールと初期設定、TeamSpeak3導入完了の状態で一度質問してみよう(今ここ)
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
※実際にwgetしたTeamSpeak3サーバー用ファイル(Linux 64bit用)
|
|
15
|
+
###【iptablesの設定】
|
|
16
|
+
※#は、質問文記載の為に全角に置き換えたもの
|
|
16
17
|
|
|
17
|
-
###【OSインストール後、トラブルまでに行った内容】
|
|
18
|
-
サーバーOSインストール後に実施した内容:全てrootで実施
|
|
19
|
-
|
|
20
|
-
**1. [http://server-setting.info/ubuntu/first-setting-ubuntu-server.html](http://server-setting.info/ubuntu/first-setting-ubuntu-server.html)を参考に「apt-get update」「apt-get upgrade」「vim」「sysv-rc-conf」「iptables」をインストールと設定(iptablesのみ他を参考)、OS表示言語は「英語」**
|
|
21
|
-
|
|
22
|
-
**2. 以下の内容でSSHを変更**
|
|
23
|
-
/etc/ssh/sshd_config
|
|
24
|
-
# ポート番号を 22 (デフォルト)から10022へ変更する
|
|
25
|
-
Port 10022
|
|
26
|
-
# SSHのプロトコルをSSH2のみ対応とする
|
|
27
|
-
Protocol 2
|
|
28
|
-
# rootでのログインを不可とする
|
|
29
|
-
PermitRootLogin no
|
|
30
|
-
# パスワードでのログインを許可する
|
|
31
|
-
PasswordAuthentication yes
|
|
32
|
-
# パスワードなしでのログインを不可とする
|
|
33
|
-
PermitEmptyPasswords no
|
|
34
|
-
# 管理用ユーザだけログインを許可する
|
|
35
|
-
AllowUsers 管理用ユーザー名
|
|
36
|
-
|
|
37
|
-
**3.以下のデーモンを停止**
|
|
38
|
-
dns-clean
|
|
39
|
-
grub-common
|
|
40
|
-
ondemand
|
|
41
|
-
pppd-dns
|
|
42
|
-
rc.local
|
|
43
|
-
rsync
|
|
44
|
-
|
|
45
|
-
**4.以下のコンソールを停止**
|
|
46
|
-
/etc/init/tty2.conf
|
|
47
|
-
/etc/init/tty3.conf
|
|
48
|
-
/etc/init/tty4.conf
|
|
49
|
-
/etc/init/tty5.conf
|
|
50
|
-
/etc/init/tty6.conf
|
|
51
|
-
|
|
52
|
-
**5.TeamSpeak3管理用ユーザー(非sudo権限)を作成し、homeディレクトリでTeamSpeak3をwgetし、以降は下記URLのガイドを参考に
|
|
53
|
-
[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)
|
|
54
|
-
動作完了まで設定。
|
|
55
|
-
この時点で管理者の認証、ライセンスの認証、第三者との通話テストに問題はありませんでした。**
|
|
56
|
-
|
|
57
|
-
**6.iptablesの設定(ここでトラブル)**
|
|
58
|
-
下記フォーラムを参考にiptablesの設定を行い、TeamSpeak3クライアントからサーバーへの接続ができなくなりました。
|
|
59
|
-
[http://forum.teamspeak.com/threads/108259-iptables-rules](http://forum.teamspeak.com/threads/108259-iptables-rules)
|
|
60
|
-
|
|
61
|
-
行ったiptables設定内容
|
|
62
18
|
/etc/profile.d/iptables_set.sh
|
|
63
19
|
|
|
64
|
-
|
|
20
|
+
#flush
|
|
65
21
|
iptables -t nat -F
|
|
66
22
|
iptables -t nat -X
|
|
67
23
|
iptables -t mangle -F
|
|
68
24
|
iptables -t mangle -X
|
|
69
25
|
|
|
70
|
-
|
|
26
|
+
#Teamspeak
|
|
71
27
|
iptables -A INPUT -p udp --dport 9987 -j ACCEPT
|
|
72
28
|
iptables -A INPUT -p udp --sport 9987 -j ACCEPT
|
|
73
29
|
|
|
@@ -77,25 +33,83 @@
|
|
|
77
33
|
iptables -A INPUT -p tcp --dport 10011 -j ACCEPT
|
|
78
34
|
iptables -A INPUT -p tcp --sport 10011 -j ACCEPT
|
|
79
35
|
|
|
80
|
-
|
|
36
|
+
#HTTP(s)
|
|
81
37
|
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
|
82
38
|
iptables -A INPUT -p tcp --sport 80 -j ACCEPT
|
|
83
39
|
|
|
84
40
|
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
|
|
85
41
|
iptables -A INPUT -p tcp --sport 443 -j ACCEPT
|
|
86
42
|
|
|
87
|
-
|
|
43
|
+
#SSH
|
|
88
44
|
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
|
|
89
45
|
iptables -A INPUT -p tcp --sport 22 -j ACCEPT
|
|
90
46
|
|
|
91
|
-
|
|
47
|
+
#DNS
|
|
92
48
|
iptables -A INPUT -p udp --dport 53 -j ACCEPT
|
|
93
49
|
iptables -A INPUT -p udp --sport 53 -j ACCEPT
|
|
94
50
|
|
|
95
|
-
|
|
51
|
+
#SECURE
|
|
96
52
|
iptables -P INPUT DROP
|
|
97
53
|
iptables -P FORWARD DROP
|
|
98
54
|
iptables -P OUTPUT ACCEPT
|
|
99
55
|
|
|
100
56
|
service iptables save
|
|
101
|
-
service iptables restart
|
|
57
|
+
service iptables restart
|
|
58
|
+
|
|
59
|
+
###【構成】
|
|
60
|
+
**<ユーザー>**
|
|
61
|
+
root : iptablesの設定ファイルを/etc/profile.d/iptables_set.shで保持
|
|
62
|
+
管理用ユーザー : ログインと各種操作用
|
|
63
|
+
TeamSpeakユーザー : homeディレクトリにTeamSpeak3のパッケージを保持、sudo権限なし
|
|
64
|
+
|
|
65
|
+
**<インストール済みパッケージ>**
|
|
66
|
+
「vim」「sysv-rc-conf」「iptables」(rootで導入)
|
|
67
|
+
日本語化は未導入
|
|
68
|
+
|
|
69
|
+
**<停止させたデーモン>**
|
|
70
|
+
「dns-clean」「grub-common」「ondemand」「pppd-dns」「rc.local」「rsync」
|
|
71
|
+
|
|
72
|
+
**<停止させたコンソール>**
|
|
73
|
+
/etc/init/tty2.conf ~ tty6.conf まで停止中
|
|
74
|
+
|
|
75
|
+
**<SSHの設定>**
|
|
76
|
+
/etc/ssh/sshd_config
|
|
77
|
+
#ポート番号を 22 (デフォルト)から10022へ変更する
|
|
78
|
+
Port 10022
|
|
79
|
+
#SSHのプロトコルをSSH2のみ対応とする
|
|
80
|
+
Protocol 2
|
|
81
|
+
#rootでのログインを不可とする
|
|
82
|
+
PermitRootLogin no
|
|
83
|
+
#パスワードでのログインを許可する
|
|
84
|
+
PasswordAuthentication yes
|
|
85
|
+
#パスワードなしでのログインを不可とする
|
|
86
|
+
PermitEmptyPasswords no
|
|
87
|
+
#管理用ユーザだけログインを許可する
|
|
88
|
+
AllowUsers 管理用ユーザー名
|
|
89
|
+
|
|
90
|
+
###【環境】
|
|
91
|
+
サーバーOS:Ubuntu server 14.04 - 64bit (新規インストール)
|
|
92
|
+
[https://help.sakura.ad.jp/app/answers/detail/a_id/2403/~/%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0os%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%82%AC%E3%82%A4%E3%83%89---ubuntu-12.04%2F14.04](https://help.sakura.ad.jp/app/answers/detail/a_id/2403/~/%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0os%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%82%AC%E3%82%A4%E3%83%89---ubuntu-12.04%2F14.04)
|
|
93
|
+
|
|
94
|
+
サーバー:さくらVPS 石狩リージョン
|
|
95
|
+
[http://vps.sakura.ad.jp/](http://vps.sakura.ad.jp/)
|
|
96
|
+
|
|
97
|
+
今回動作させたいソフトウェア:TeamSpeak3 (ボイスチャットのサーバー)
|
|
98
|
+
[http://teamspeak.gameserver.gamed.de/ts3/releases/3.0.11.4/teamspeak3-server_linux-amd64-3.0.11.4.tar.gz](http://teamspeak.gameserver.gamed.de/ts3/releases/3.0.11.4/teamspeak3-server_linux-amd64-3.0.11.4.tar.gz)
|
|
99
|
+
※実際にwgetしたTeamSpeak3サーバー用ファイル(Linux 64bit用)
|
|
100
|
+
|
|
101
|
+
###【参考にしたサイト】
|
|
102
|
+
【iptables】TeamSpeak3向けのiptables設定 VPS版
|
|
103
|
+
[http://forum.teamspeak.com/threads/108259-iptables-rules](http://forum.teamspeak.com/threads/108259-iptables-rules)
|
|
104
|
+
|
|
105
|
+
【基本設定】評判のさくらのVPSを使うときに最初にやっておきたいこと(Ubuntu編)
|
|
106
|
+
[http://server-setting.info/ubuntu/first-setting-ubuntu-server.html](http://server-setting.info/ubuntu/first-setting-ubuntu-server.html)
|
|
107
|
+
|
|
108
|
+
【TeamSpeak3の導入】TS3 wiki サーバ/Linux
|
|
109
|
+
[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)
|
|
110
|
+
|
|
111
|
+
【さくらVPS公式】iptablesの設定
|
|
112
|
+
[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)
|
|
113
|
+
|
|
114
|
+
【TS3 iptables設定例】備忘録: [CentOS] TeamSpeak 3 サーバー構築
|
|
115
|
+
[http://tsubasa3611.blog130.fc2.com/blog-entry-169.html](http://tsubasa3611.blog130.fc2.com/blog-entry-169.html)
|
2
iptables設定の記載
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -55,10 +55,47 @@
|
|
|
55
55
|
この時点で管理者の認証、ライセンスの認証、第三者との通話テストに問題はありませんでした。**
|
|
56
56
|
|
|
57
57
|
**6.iptablesの設定(ここでトラブル)**
|
|
58
|
-
|
|
58
|
+
下記フォーラムを参考にiptablesの設定を行い、TeamSpeak3クライアントからサーバーへの接続ができなくなりました。
|
|
59
|
+
[http://forum.teamspeak.com/threads/108259-iptables-rules](http://forum.teamspeak.com/threads/108259-iptables-rules)
|
|
59
60
|
|
|
61
|
+
行ったiptables設定内容
|
|
60
|
-
|
|
62
|
+
/etc/profile.d/iptables_set.sh
|
|
61
|
-
[http://tsubasa3611.blog130.fc2.com/blog-entry-169.html](http://tsubasa3611.blog130.fc2.com/blog-entry-169.html)
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
# flush
|
|
65
|
+
iptables -t nat -F
|
|
66
|
+
iptables -t nat -X
|
|
67
|
+
iptables -t mangle -F
|
|
68
|
+
iptables -t mangle -X
|
|
69
|
+
|
|
70
|
+
# Teamspeak
|
|
71
|
+
iptables -A INPUT -p udp --dport 9987 -j ACCEPT
|
|
72
|
+
iptables -A INPUT -p udp --sport 9987 -j ACCEPT
|
|
73
|
+
|
|
74
|
+
iptables -A INPUT -p tcp --dport 30033 -j ACCEPT
|
|
75
|
+
iptables -A INPUT -p tcp --sport 30033 -j ACCEPT
|
|
76
|
+
|
|
77
|
+
iptables -A INPUT -p tcp --dport 10011 -j ACCEPT
|
|
78
|
+
iptables -A INPUT -p tcp --sport 10011 -j ACCEPT
|
|
79
|
+
|
|
80
|
+
# HTTP(s)
|
|
81
|
+
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
|
82
|
+
iptables -A INPUT -p tcp --sport 80 -j ACCEPT
|
|
83
|
+
|
|
84
|
+
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
|
|
85
|
+
iptables -A INPUT -p tcp --sport 443 -j ACCEPT
|
|
86
|
+
|
|
87
|
+
# SSH
|
|
88
|
+
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
|
|
89
|
+
iptables -A INPUT -p tcp --sport 22 -j ACCEPT
|
|
90
|
+
|
|
91
|
+
# DNS
|
|
92
|
+
iptables -A INPUT -p udp --dport 53 -j ACCEPT
|
|
93
|
+
iptables -A INPUT -p udp --sport 53 -j ACCEPT
|
|
94
|
+
|
|
95
|
+
#SECURE
|
|
96
|
+
iptables -P INPUT DROP
|
|
97
|
+
iptables -P FORWARD DROP
|
|
98
|
+
iptables -P OUTPUT ACCEPT
|
|
99
|
+
|
|
100
|
+
service iptables save
|
|
101
|
+
service iptables restart
|
1
サーバーへの接続失敗について補足
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
この時点で管理者の認証、ライセンスの認証、第三者との通話テストに問題はありませんでした。**
|
|
56
56
|
|
|
57
57
|
**6.iptablesの設定(ここでトラブル)**
|
|
58
|
-
長文になるのでリンクのみとさせていただきますが、下記サイトを参考にiptablesの設定を行い、サーバーへの接続ができなくなりました。
|
|
58
|
+
長文になるのでリンクのみとさせていただきますが、下記サイトを参考にiptablesの設定を行い、TeamSpeak3クライアントからサーバーへの接続ができなくなりました。
|
|
59
59
|
|
|
60
60
|
備忘録: [CentOS] TeamSpeak 3 サーバー構築
|
|
61
61
|
[http://tsubasa3611.blog130.fc2.com/blog-entry-169.html](http://tsubasa3611.blog130.fc2.com/blog-entry-169.html)
|