Csf - заблокировать доступ с определенных стран: различия между версиями

Материал из Wiki - Iphoster - the best ever hosting and support. 2005 - 2024
Перейти к:навигация, поиск
(Новая страница: « # vi /etc/csf/csf.conf CC_DENY = "VN,CN,HK,TW,ID,SG,KR" При перезапуске должно быть так: # csf -r && service lfd restart csf: F…»)
 
 
(не показана 1 промежуточная версия этого же участника)
Строка 13: Строка 13:
  
  
 
+
'''Коды стран:'''
Список кодов стран:
+
AFGHANISTAN AF
*https://www.countryipblocks.net/allocation-of-ip-addresses-by-country.php
+
ÅLAND ISLANDS AX
 +
ALBANIA AL
 +
ALDERNEY
 +
ALGERIA (El Djazaïr) DZ
 +
AMERICAN SAMOA AS
 +
ANDORRA AD
 +
ANGOLA AO
 +
ANGUILLA AI
 +
ANTARCTICA AQ
 +
ANTIGUA AND BARBUDA AG
 +
ARGENTINA AR
 +
ARMENIA AM
 +
ARUBA AW
 +
ASCENSION ISLAND
 +
AUSTRALIA AU
 +
AUSTRIA AT
 +
AZERBAIJAN AZ
 +
BAHAMAS BS
 +
BAHRAIN BH
 +
BANGLADESH BD
 +
BARBADOS BB
 +
BELARUS BY
 +
BELGIUM BE
 +
BELIZE BZ
 +
BENIN BJ
 +
BERMUDA BM
 +
BHUTAN BT
 +
BOLIVIA BO
 +
BONAIRE, ST. EUSTATIUS, AND SABA BQ
 +
BOSNIA AND HERZEGOVINA BA
 +
BOTSWANA BW
 +
BOUVET ISLAND BV
 +
BRAZIL BR
 +
BRITISH INDIAN OCEAN TERRITORY IO
 +
BRUNEI DARUSSALAM BN
 +
BULGARIA BG
 +
BURKINA FASO BF
 +
BURUNDI BI
 +
CAMBODIA KH
 +
CAMEROON CM
 +
CANADA CA
 +
CAPE VERDE CV
 +
CAYMAN ISLANDS KY
 +
CENTRAL AFRICAN REPUBLIC CF
 +
CHAD (Tchad) TD
 +
CHANNEL ISLANDS
 +
CHILE CL
 +
CHINA CN
 +
CHRISTMAS ISLAND CX
 +
COCOS (KEELING) ISLANDS CC
 +
COLOMBIA CO
 +
COMOROS KM
 +
CONGO, REPUBLIC OF CG
 +
CONGO, THE DEMOCRATIC REPUBLIC OF THE (formerly Zaire) CD
 +
COOK ISLANDS CK
 +
COSTA RICA CR
 +
CÔTE D’IVOIRE (Ivory Coast) CI
 +
CROATIA (Hrvatska) HR
 +
CUBA CU
 +
CURAÇAO CW
 +
CYPRUS CY
 +
CZECH REPUBLIC CZ
 +
DENMARK DK
 +
DJIBOUTI DJ
 +
DOMINICA DM
 +
DOMINICAN REPUBLIC DO
 +
ECUADOR EC
 +
EGYPT EG
 +
EL SALVADOR SV
 +
EQUATORIAL GUINEA GQ
 +
ERITREA ER
 +
ESTONIA EE
 +
ETHIOPIA ET
 +
EUROPEAN UNION
 +
FAEROE ISLANDS FO
 +
FALKLAND ISLANDS (MALVINAS) FK
 +
FIJI FJ
 +
FINLAND FI
 +
FRANCE FR
 +
FRENCH GUIANA GF
 +
FRENCH POLYNESIA PF
 +
FRENCH SOUTHERN TERRITORIES TF
 +
GABON GA
 +
GAMBIA, THE GM
 +
GEORGIA GE
 +
GERMANY (Deutschland) DE
 +
GHANA GH
 +
GIBRALTAR GI
 +
GREAT BRITAIN (United Kingdom) GB
 +
GREECE GR
 +
GREENLAND GL
 +
GRENADA GD
 +
GUADELOUPE GP
 +
GUAM GU
 +
GUATEMALA GT
 +
GUERNSEY GG
 +
GUINEA GN
 +
GUINEA-BISSAU GW
 +
GUYANA GY
 +
HAITI HT
 +
HEARD ISLAND AND MCDONALD ISLANDS HM
 +
HONDURAS HN
 +
HONG KONG (Special Administrative Region of China) HK
 +
HUNGARY HU
 +
ICELAND IS
 +
INDIA IN
 +
INDONESIA ID
 +
INTERNATIONAL ORGANIZATIONS
 +
IRAN (Islamic Republic of Iran) IR
 +
IRAQ IQ
 +
IRELAND IE
 +
ISLE OF MAN IM
 +
ISRAEL IL
 +
ITALY IT
 +
JAMAICA JM
 +
JAPAN JP
 +
JERSEY JE
 +
JORDAN (Hashemite Kingdom of Jordan) JO
 +
KAZAKHSTAN KZ
 +
KENYA KE
 +
KIRIBATI KI
 +
KOREA (Democratic Peoples Republic of [North] Korea) KP
 +
KOREA (Republic of [South] Korea) KR
 +
KUWAIT KW
 +
KYRGYZSTAN KG
 +
LAO PEOPLE’S DEMOCRATIC REPUBLIC LA
 +
LATVIA LV
 +
LEBANON LB
 +
LESOTHO LS
 +
LIBERIA LR
 +
LIBYA (Libyan Arab Jamahirya) LY
 +
LIECHTENSTEIN (Fürstentum Liechtenstein) LI
 +
LITHUANIA LT
 +
LUXEMBOURG LU
 +
MACAO (Special Administrative Region of China) MO
 +
MACEDONIA (Former Yugoslav Republic of Macedonia) MK
 +
MADAGASCAR MG
 +
MALAWI MW
 +
MALAYSIA MY
 +
MALDIVES MV
 +
MALI ML
 +
MALTA MT
 +
MARSHALL ISLANDS MH
 +
MARTINIQUE MQ
 +
MAURITANIA MR
 +
MAURITIUS MU
 +
MAYOTTE YT
 +
MEXICO MX
 +
MICRONESIA (Federated States of Micronesia) FM
 +
MOLDOVA MD
 +
MONACO MC
 +
MONGOLIA MN
 +
MONTENEGRO ME
 +
MONTSERRAT MS
 +
MOROCCO MA
 +
MOZAMBIQUE (Moçambique) MZ
 +
MYANMAR (formerly Burma) MM
 +
NAMIBIA NA
 +
NAURU NR
 +
NEPAL NP
 +
NETHERLANDS NL
 +
NETHERLANDS ANTILLES (obsolete) AN
 +
NEW CALEDONIA NC
 +
NEW ZEALAND NZ
 +
NICARAGUA NI
 +
NIGER NE
 +
NIGERIA NG
 +
NIUE NU
 +
NORFOLK ISLAND NF
 +
NORTHERN MARIANA ISLANDS MP
 +
NORWAY NO
 +
OMAN OM
 +
PAKISTAN PK
 +
PALAU PW
 +
PALESTINIAN TERRITORIES PS
 +
PANAMA PA
 +
PAPUA NEW GUINEA PG
 +
PARAGUAY PY
 +
PERU PE
 +
PHILIPPINES PH
 +
PITCAIRN PN
 +
POLAND PL
 +
PORTUGAL PT
 +
PUERTO RICO PR
 +
QATAR QA
 +
RÉUNION RE
 +
ROMANIA RO
 +
RUSSIAN FEDERATION RU
 +
RWANDA RW
 +
SAINT BARTHÉLEMY BL
 +
SAINT HELENA SH
 +
SAINT KITTS AND NEVIS KN
 +
SAINT LUCIA LC
 +
SAINT MARTIN (French portion) MF
 +
SAINT PIERRE AND MIQUELON PM
 +
SAINT VINCENT AND THE GRENADINES VC
 +
SAMOA (formerly Western Samoa) WS
 +
SAN MARINO (Republic of) SM
 +
SAO TOME AND PRINCIPE ST
 +
SAUDI ARABIA (Kingdom of Saudi Arabia) SA
 +
SENEGAL SN
 +
SERBIA (Republic of Serbia) RS
 +
SEYCHELLES SC
 +
SIERRA LEONE SL
 +
SINGAPORE SG
 +
SINT MAARTEN SX
 +
SLOVAKIA (Slovak Republic) SK
 +
SLOVENIA SI
 +
SOLOMON ISLANDS SB
 +
SOMALIA SO
 +
SOUTH AFRICA (Zuid Afrika) ZA
 +
SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS GS
 +
SOUTH SUDAN SS
 +
SOVIET UNION (Internet code still used)
 +
SPAIN (España) ES
 +
SRI LANKA (formerly Ceylon) LK
 +
SUDAN SD
 +
SURINAME SR
 +
SVALBARD AND JAN MAYEN SJ
 +
SWAZILAND SZ
 +
SWEDEN SE
 +
SWITZERLAND (Confederation of Helvetia) CH
 +
SYRIAN ARAB REPUBLIC SY
 +
TAIWAN (“Chinese Taipei” for IOC) TW
 +
TAJIKISTAN TJ
 +
TANGANYIKA
 +
TANZANIA TZ
 +
THAILAND TH
 +
TOGO TG
 +
TOKELAU TK
 +
TONGA TO
 +
TRINIDAD AND TOBAGO TT
 +
TUNISIA TN
 +
TURKEY TR
 +
TURKMENISTAN TM
 +
TURKS AND CAICOS ISLANDS TC
 +
TUVALU TV
 +
UGANDA UG
 +
UKRAINE UA
 +
UNITED ARAB EMIRATES AE
 +
UNITED KINGDOM GB
 +
UNITED STATES US
 +
UNITED STATES MINOR OUTLYING ISLANDS UM
 +
URUGUAY UY
 +
UZBEKISTAN UZ
 +
VANUATU VU
 +
VATICAN CITY (Holy See) VA
 +
VENEZUELA VE
 +
VIET NAM VN
 +
VIRGIN ISLANDS, BRITISH VG
 +
VIRGIN ISLANDS, U.S. VI
 +
YUGOSLAVIA (Internet code still used)
 +
WALLIS AND FUTUNA WF
 +
WESTERN SAHARA (formerly Spanish Sahara) EH
 +
YEMEN (Yemen Arab Republic) YE
 +
ZAMBIA (formerly Northern Rhodesia) ZM
 +
ZANZIBAR
 +
ZIMBABWE ZW

Текущая версия на 09:52, 25 декабря 2022


# vi /etc/csf/csf.conf
CC_DENY = "VN,CN,HK,TW,ID,SG,KR"


При перезапуске должно быть так:

# csf -r && service lfd restart
csf: FASTSTART loading CC_DENY [vn] (IPv4)
csf: FASTSTART loading CC_DENY [cn] (IPv4)
csf: FASTSTART loading CC_DENY [hk] (IPv4)
csf: FASTSTART loading CC_DENY [tw] (IPv4)


Коды стран:

AFGHANISTAN	AF
ÅLAND ISLANDS	AX
ALBANIA	AL
ALDERNEY	 
ALGERIA (El Djazaïr)	DZ
AMERICAN SAMOA	AS
ANDORRA	AD
ANGOLA	AO
ANGUILLA	AI
ANTARCTICA	AQ
ANTIGUA AND BARBUDA	AG
ARGENTINA	AR
ARMENIA	AM
ARUBA	AW
ASCENSION ISLAND	 
AUSTRALIA	AU
AUSTRIA	AT
AZERBAIJAN	AZ
BAHAMAS	BS
BAHRAIN	BH
BANGLADESH	BD
BARBADOS	BB
BELARUS	BY
BELGIUM	BE
BELIZE	BZ
BENIN	BJ
BERMUDA	BM
BHUTAN	BT
BOLIVIA	BO
BONAIRE, ST. EUSTATIUS, AND SABA	BQ
BOSNIA AND HERZEGOVINA	BA
BOTSWANA	BW
BOUVET ISLAND	BV
BRAZIL	BR
BRITISH INDIAN OCEAN TERRITORY	IO
BRUNEI DARUSSALAM	BN
BULGARIA	BG
BURKINA FASO	BF
BURUNDI	BI
CAMBODIA	KH
CAMEROON	CM
CANADA	CA
CAPE VERDE	CV
CAYMAN ISLANDS	KY
CENTRAL AFRICAN REPUBLIC	CF
CHAD (Tchad)	TD
CHANNEL ISLANDS	 
CHILE	CL
CHINA	CN
CHRISTMAS ISLAND	CX
COCOS (KEELING) ISLANDS	CC
COLOMBIA	CO
COMOROS	KM
CONGO, REPUBLIC OF	CG
CONGO, THE DEMOCRATIC REPUBLIC OF THE (formerly Zaire)	CD
COOK ISLANDS	CK
COSTA RICA	CR
CÔTE D’IVOIRE (Ivory Coast)	CI
CROATIA (Hrvatska)	HR
CUBA	CU
CURAÇAO	CW
CYPRUS	CY
CZECH REPUBLIC	CZ
DENMARK	DK
DJIBOUTI	DJ
DOMINICA	DM
DOMINICAN REPUBLIC	DO
ECUADOR	EC
EGYPT	EG
EL SALVADOR	SV
EQUATORIAL GUINEA	GQ
ERITREA	ER
ESTONIA	EE
ETHIOPIA	ET
EUROPEAN UNION	 
FAEROE ISLANDS	FO
FALKLAND ISLANDS (MALVINAS)	FK
FIJI	FJ
FINLAND	FI
FRANCE	FR
FRENCH GUIANA	GF
FRENCH POLYNESIA	PF
FRENCH SOUTHERN TERRITORIES	TF 
GABON	GA
GAMBIA, THE	GM 
GEORGIA	GE
GERMANY (Deutschland)	DE
GHANA	GH
GIBRALTAR	GI
GREAT BRITAIN (United Kingdom)	GB
GREECE	GR
GREENLAND	GL
GRENADA	GD
GUADELOUPE	GP
GUAM	GU
GUATEMALA	GT
GUERNSEY	GG
GUINEA	GN
GUINEA-BISSAU	GW
GUYANA	GY
HAITI	HT
HEARD ISLAND AND MCDONALD ISLANDS	HM
HONDURAS	HN
HONG KONG (Special Administrative Region of China)	HK
HUNGARY	HU
ICELAND	IS
INDIA	IN
INDONESIA	ID
INTERNATIONAL ORGANIZATIONS	 
IRAN (Islamic Republic of Iran)	IR
IRAQ	IQ
IRELAND	IE
ISLE OF MAN	IM
ISRAEL	IL
ITALY	IT
JAMAICA	JM
JAPAN	JP
JERSEY	JE
JORDAN (Hashemite Kingdom of Jordan)	JO 
KAZAKHSTAN	KZ
KENYA	KE
KIRIBATI	KI
KOREA (Democratic Peoples Republic of [North] Korea)	KP
KOREA (Republic of [South] Korea)	KR
KUWAIT	KW
KYRGYZSTAN	KG
LAO PEOPLE’S DEMOCRATIC REPUBLIC	LA
LATVIA	LV
LEBANON	LB
LESOTHO	LS
LIBERIA	LR
LIBYA (Libyan Arab Jamahirya)	LY
LIECHTENSTEIN (Fürstentum Liechtenstein)	LI
LITHUANIA	LT
LUXEMBOURG	LU
MACAO (Special Administrative Region of China)	MO
MACEDONIA (Former Yugoslav Republic of Macedonia)	MK
MADAGASCAR	MG
MALAWI	MW
MALAYSIA	MY
MALDIVES	MV
MALI	ML
MALTA	MT
MARSHALL ISLANDS	MH
MARTINIQUE	MQ
MAURITANIA	MR
MAURITIUS	MU
MAYOTTE	YT
MEXICO	MX
MICRONESIA (Federated States of Micronesia)	FM
MOLDOVA	MD
MONACO	MC
MONGOLIA	MN
MONTENEGRO	ME
MONTSERRAT	MS
MOROCCO	MA
MOZAMBIQUE (Moçambique)	MZ
MYANMAR (formerly Burma)	MM
NAMIBIA	NA
NAURU	NR
NEPAL	NP
NETHERLANDS	NL
NETHERLANDS ANTILLES (obsolete)	AN
NEW CALEDONIA	NC
NEW ZEALAND	NZ
NICARAGUA	NI
NIGER	NE
NIGERIA	NG
NIUE	NU
NORFOLK ISLAND	NF
NORTHERN MARIANA ISLANDS	MP
NORWAY	NO
OMAN	OM
PAKISTAN	PK
PALAU	PW
PALESTINIAN TERRITORIES	PS
PANAMA	PA
PAPUA NEW GUINEA	PG
PARAGUAY	PY
PERU	PE
PHILIPPINES	PH
PITCAIRN	PN
POLAND	PL
PORTUGAL	PT
PUERTO RICO	PR
QATAR	QA
RÉUNION	RE
ROMANIA	RO
RUSSIAN FEDERATION	RU
RWANDA	RW
SAINT BARTHÉLEMY	BL
SAINT HELENA	SH
SAINT KITTS AND NEVIS	KN
SAINT LUCIA	LC
SAINT MARTIN (French portion)	MF
SAINT PIERRE AND MIQUELON	PM
SAINT VINCENT AND THE GRENADINES	VC
SAMOA (formerly Western Samoa)	WS
SAN MARINO (Republic of)	SM
SAO TOME AND PRINCIPE	ST
SAUDI ARABIA (Kingdom of Saudi Arabia)	SA
SENEGAL	SN
SERBIA (Republic of Serbia)	RS
SEYCHELLES	SC
SIERRA LEONE	SL
SINGAPORE	SG
SINT MAARTEN	SX
SLOVAKIA (Slovak Republic)	SK
SLOVENIA	SI
SOLOMON ISLANDS	SB
SOMALIA	SO
SOUTH AFRICA (Zuid Afrika)	ZA
SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS	GS
SOUTH SUDAN	SS
SOVIET UNION (Internet code still used)	 
SPAIN (España)	ES
SRI LANKA (formerly Ceylon)	LK
SUDAN	SD
SURINAME	SR
SVALBARD AND JAN MAYEN	SJ
SWAZILAND	SZ
SWEDEN	SE
SWITZERLAND (Confederation of Helvetia)	CH
SYRIAN ARAB REPUBLIC	SY
TAIWAN (“Chinese Taipei” for IOC)	TW
TAJIKISTAN	TJ
TANGANYIKA	 
TANZANIA	TZ
THAILAND	TH
TOGO	TG
TOKELAU	TK
TONGA	TO
TRINIDAD AND TOBAGO	TT
TUNISIA	TN
TURKEY	TR
TURKMENISTAN	TM
TURKS AND CAICOS ISLANDS	TC
TUVALU	TV 
UGANDA	UG
UKRAINE	UA
UNITED ARAB EMIRATES	AE
UNITED KINGDOM	GB
UNITED STATES	US
UNITED STATES MINOR OUTLYING ISLANDS	UM
URUGUAY	UY
UZBEKISTAN	UZ
VANUATU	VU
VATICAN CITY (Holy See)	VA
VENEZUELA	VE
VIET NAM	VN
VIRGIN ISLANDS, BRITISH	VG
VIRGIN ISLANDS, U.S.	VI
YUGOSLAVIA (Internet code still used)	 
WALLIS AND FUTUNA	WF
WESTERN SAHARA (formerly Spanish Sahara)	EH
YEMEN (Yemen Arab Republic)	YE
ZAMBIA (formerly Northern Rhodesia)	ZM
ZANZIBAR	 
ZIMBABWE	ZW