Showing posts with label Network. Show all posts
Showing posts with label Network. Show all posts
Monday, October 29, 2012
how to disable esmtp inspection feature (Cisco)?
ESMTP TLS Configuration
Note: If you use Transport Layer Security (TLS) encryption for e-mail communication then the ESMTP inspection feature (enabled by default) in the PIX drops the packets. In order to allow the e-mails with TLS enabled, disable the ESMTP inspection feature as this output shows. Refer to Cisco bug ID CSCtn08326 (registered customers only) for more information.
pix(config)#policy-map global_policy
pix(config-pmap)#class inspection_default
pix(config-pmap-c)#no inspect esmtp
pix(config-pmap-c)#exit
pix(config-pmap)#exit
Reference: http://www.cisco.com/en/US/products/hw/vpndevc/ps2030/products_configuration_example09186a00806745b8.shtml
Sunday, October 21, 2012
How to use wlctl command in router?
wlctl
Usage: wlctl [-a|i <adapter>] [-h] [-d|u|x] <command> [arguments]
-h
this message
-a, -i
adapter name or number
-d
signed integer
-u
unsigned integer
-x
hexdecimal
ver
get version information
cmds
generate a short list of available commands
up
reinitialize and mark adapter up (operational)
down
reset and mark adapter down (disabled)
out
mark adapter down but do not reset hardware(disabled).
On dualband cards, cards must be bandlocked before use.
clk
set board clock state. return error for set_clk attempt if the driver is not down
0: clock off
1: clock on
restart
Restart driver. Driver must already be down.
reboot
Reboot platform
ucflags
Get/Set ucode flags
radio
Set the radio on or off.
"on" or "off"
dump
print driver software state and chip registers to stdout
srdump
print contents of SPROM to stdout
nvdump
print nvram variables to stdout
nvset
set an nvram variable
name=value (no spaces around '=')
nvget
get the value of an nvram variable
revinfo
get hardware revision information
msglevel
set driver console debugging message bitvector
type 'wl msglevel ?' for values
PM
set driver power management mode:
0: CAM (constantly awake)
1: PS (power-save)
2: FAST PS mode
wake
set driver power-save mode sleep state:
0: core-managed
1: awake
promisc
set promiscuous mode ethernet address reception
0 - disable
1 - enable
monitor
set monitor mode
0 - disable
1 - enable active monitor mode (interface still operates)
frag
Deprecated. Use fragthresh.
rts
Deprecated. Use rtsthresh.
cwmin
Set the cwmin. (integer [1, 255])
cwmax
Set the cwmax. (integer [256, 2047])
srl
Set the short retry limit. (integer [1, 255])
lrl
Set the long retry limit. (integer [1, 255])
rate
force a fixed rate:
valid values for 802.11a are (6, 9, 12, 18, 24, 36, 48, 54)
valid values for 802.11b are (1, 2, 5.5, 11)
valid values for 802.11g are (1, 2, 5.5, 6, 9, 11, 12, 18, 24, 36, 48, 54)
-1 (default) means automatically determine the best rate
mrate
force a fixed multicast rate:
valid values for 802.11a are (6, 9, 12, 18, 24, 36, 48, 54)
valid values for 802.11b are (1, 2, 5.5, 11)
valid values for 802.11g are (1, 2, 5.5, 6, 9, 11, 12, 18, 24, 36, 48, 54)
-1 (default) means automatically determine the best rate
a_rate
force a fixed rate for the A PHY:
valid values for 802.11a are (6, 9, 12, 18, 24, 36, 48, 54)
-1 (default) means automatically determine the best rate
a_mrate
force a fixed multicast rate for the A PHY:
valid values for 802.11a are (6, 9, 12, 18, 24, 36, 48, 54)
-1 (default) means automatically determine the best rate
bg_rate
force a fixed rate for the B/G PHY:
valid values for 802.11b are (1, 2, 5.5, 11)
valid values for 802.11g are (1, 2, 5.5, 6, 9, 11, 12, 18, 24, 36, 48, 54)
-1 (default) means automatically determine the best rate
bg_mrate
force a fixed multicast rate for the B/G PHY:
valid values for 802.11b are (1, 2, 5.5, 11)
valid values for 802.11g are (1, 2, 5.5, 6, 9, 11, 12, 18, 24, 36, 48, 54)
-1 (default) means automatically determine the best rate
infra
Set Infrastructure mode: 0 (IBSS) or 1 (Infra BSS)
ap
Set AP mode: 0 (STA) or 1 (AP)
bssid
Get the BSSID value, error if STA and not associated
channel
Set the channel:
valid channels for 802.11b/g (2.4GHz band) are 1 through 14
valid channels for 802.11a (5 GHz band) are:
36, 40, 44, 48, 52, 56, 60, 64, 100, 104,
108, 112, 116, 120, 124, 128, 132, 136,
140, 149, 153, 157, 161,184, 188, 192,
196, 200, 204, 208, 212, 216
tssi
Get the tssi value from radio
txpwr
Set tx power in milliwatts. Range [1, 84].
txpwr1
Set tx power in in various units. Choose one of (default: dbm):
-d dbm units
-q quarter dbm units
-m milliwatt units
Can be combined with:
-o turn on override to disable regulatory and other limitations
Use wl txpwr -1 to restore defaults
txpathpwr
Turn the tx path power on or off on 2050 radios
txpwrlimit
Return current tx power limit
powerindex
Set the transmit power for A band(0-63).
-1 - default value
atten
Set the transmit attenuation for B band. Args: bb radio txctl1.
auto to revert to automatic control
manual to supspend automatic control
phyreg
Get/Set a phy register:
offset [ value ] [ band ]
radioreg
Get/Set a radio register:
offset [ value ] [ band ]
shmem
Get/Set a shared memory location:
offset [ value ] [ band ]
macreg
Get/Set any mac registers(include IHR and SB):
macreg offset size[2,4] [value] [ band ]
ucantdiv
Enable/disable ucode antenna diversity (1/0 or on/off)
antdiv
Set antenna diversity for rx
0 - force use of antenna 0
1 - force use of antenna 1
3 - automatic selection of antenna diversity
txant
Set the transmit antenna
0 - force use of antenna 0
1 - force use of antenna 1
3 - use the RX antenna selection that was in force during
the most recently received good PLCP header
plcphdr
Set the plcp header.
"long" or "auto" or "debug"
phytype
Get phy type
scbdump
print driver scb state to stdout
rateparam
set driver rate selection tunables
arg 1: tunable id
arg 2: tunable value
wepstatus
Set or Get WEP status
wepstatus [on|off]
primary_key
Set or get index of primary key
addwep
Set an encryption key. The key must be 5, 13 or 16 bytes long, or
10, 26, 32, or 64 hex digits long. The encryption algorithm is
automatically selected based on the key size. keytype is accepted
only when key length is 16 bytes/32 hex digits and specifies
whether AES-OCB or AES-CCM encryption is used. Default is ccm.
addwep <keyindex> <keydata> [ocb | ccm] [notx] [xx:xx:xx:xx:xx:xx]
rmwep
Remove the encryption key at the specified key index.
keys
Prints a list of the current WEP keys
tsc
Print Tx Sequence Couter for key at specified key index.
wsec_test
Generate wsec errors
wsec_test <test_type> <keyindex|xx:xx:xx:xx:xx:xx>
type 'wl wsec_test ?' for test_types
tkip_countermeasures
Enable or disable TKIP countermeasures (TKIP-enabled AP only)
0 - disable
1 - enable
wsec_restrict
Drop unencrypted packets if WSEC is enabled
0 - disable
1 - enable
eap
restrict traffic to 802.1X packets until 802.1X authorization succeeds
0 - disable
1 - enable
authorize
restrict traffic to 802.1X packets until 802.1X authorization succeeds
deauthorize
do not restrict traffic to 802.1X packets until 802.1X authorization succeeds
deauthenticate
deauthenticate a STA from the AP with optional reason code (AP ONLY)
wsec
wireless security bit vector
1 - WEP enabled
2 - TKIP enabled
4 - AES enabled
8 - WSEC in software
auth
set/get 802.11 authentication type. 0 = OpenSystem, 1= SharedKey
wpa_auth
Bitvector of WPA authorization modes:
1
WPA-NONE
2
WPA-802.1X/WPA-Professional
4
WPA-PSK/WPA-Personal
64
WPA2-802.1X/WPA2-Professional
128
WPA2-PSK/WPA2-Personal
0
disable WPA
wpa_cap
set/get 802.11i RSN capabilities
set_pmk
Set passphrase for PMK in driver-resident supplicant.
scan
Initiate a scan.
Default an active scan across all channels for any SSID.
Optional arg: SSID, the SSID to scan.
Options:
-s S, --ssid=S
SSID to scan
-t ST, --scan_type=ST
[active|passive] scan type
--bss_type=BT
[bss/infra|ibss/adhoc] bss type to scan
-b MAC, --bssid=MAC
particular BSSID MAC address to scan, xx:xx:xx:xx:xx:xx
-n N, --nprobes=N
number of probes per scanned channel
-a N, --active=N
dwell time per channel for active scanning
-p N, --passive=N
dwell time per channel for passive scanning
-h N, --home=N
dwell time for the home channel between channel scans
-c L, --channels=L
comma or space separated list of channels to scan
passive
Puts scan engine into passive mode
regulatory
Get/Set regulatory domain mode (802.11d). Driver must be down.
spect
Get/Set 802.11h Spectrum Management mode.
0 - Off
1 - Loose interpretation of spec - may join non-11h APs
2 - Strict interpretation of spec - may not join non-11h APs
3 - Disable 11H and enable 11D
scanresults
Return results from last scan.
assoc
Print information about current network association.
(also known as "status")
status
Print information about current network association.
(also known as "assoc")
disassoc
Disassociate from the current BSS/IBSS.
chanlist
Deprecated. Use channels.
channels
Return valid channels for the current settings.
channels_in_country
Return valid channels for the country specified.
Arg 1 is the country abbreviation
Arg 2 is the band(a or b)
curpower
Return current tx power settings.
-q (quiet): estimated power only.
txinstpwr
Return tx power based on instant TSSI
scansuppress
Suppress all scans for testing.
0 - allow scans
1 - suppress scans
evm
Start an EVM test on the given channel, or stop EVM test.
Arg 1 is channel number 1-14, or "off" or 0 to stop the test.
Arg 2 is optional rate (1, 2, 5.5 or 11)
rateset
Returns or sets the supported and basic rateset, (b) indicates basic
With no args, returns the rateset. Args are
rateset "default" | "all" | <arbitrary rateset>
default - driver defaults
all - all rates are basic rates
arbitrary rateset - list of rates
List of rates are in Mbps and each rate is optionally followed
by "(b)" or "b" for a Basic rate. Example: 1(b) 2b 5.5 11
At least one rate must be Basic for a legal rateset.
roam_trigger
Set the roam trigger RSSI threshold: roam_trigger [integer [, a/b]]
roam_delta
Set the roam candidate qualification delta. roam_delta [integer [, a/b]]
roam_scan_period
Set the roam candidate qualification delta. (integer)
suprates
Returns or sets the 11g override for the supported rateset
With no args, returns the rateset. Args are a list of rates,
or 0 or -1 to specify an empty rateset to clear the override.
List of rates are in Mbps, example: 1 2 5.5 11
scan_channel_time
Get/Set scan channel time
scan_unassoc_time
Get/Set unassociated scan channel dwell time
scan_home_time
Get/Set scan home channel dwell time
scan_passive_time
Get/Set passive scan channel dwell time
scan_nprobes
Get/Set scan parameter for number of probes to use per channel scanned
prb_resp_timeout
Get/Set probe response timeout
channel_qa
Get last channel quality measurment
channel_qa_start
Start a channel quality measurment
country
Select Country code for use with 802.11d
Use either long name or abbreviation from ISO 3166.
Use 'wl country list [band(a or b)]' for the list of supported countries
locale
OBSOLETE: use "wl country"
Select the country:
Worldwide
Thailand
Israel
Jordan
China
Japan
USA/Canada/ANZ
Europe
USAlow
JapanHigh
All
join
Join a specified network SSID.
Join syntax is: join <ssid> [key xxxxx] [imode bss|ibss] [amode open|shared|wpa|wpapsk|wpa2|wpa2psk|wpanone]
ssid
Set or get a configuration's SSID.
wl ssid [-C num]|[--cfg=num] [<ssid>]
If the configuration index 'num' is not given, configuraion #0 is assumed and
setting will initiate an assoication attempt if in infrastructure mode,
or join/creation of an IBSS if in IBSS mode,
or creation of a BSS if in AP mode.
mac
Set or get the list of source MAC address matches.
wl mac xx:xx:xx:xx:xx:xx [xx:xx:xx:xx:xx:xx ...]
To Clear the list: wl mac none
macmode
Set the mode of the MAC list.
0 - Disable MAC address matching.
1 - Deny association to stations on the MAC list.
2 - Allow association to stations on the MAC list.
wds
Set or get the list of WDS member MAC addresses.
Set using a space separated list of MAC addresses.
wl wds xx:xx:xx:xx:xx:xx [xx:xx:xx:xx:xx:xx ...]
lazywds
Set or get "lazy" WDS mode (dynamically grant WDS membership to anyone).
noise
Get noise (moving average) right after tx in dBm
fqacurcy
Manufacturing test: set frequency accuracy mode.
freqacuracy syntax is: fqacurcy <channel>
Arg is channel number 1-14, or 0 to stop the test.
crsuprs
Manufacturing test: set carrier suppression mode.
carriersuprs syntax is: crsuprs <channel>
Arg is channel number 1-14, or 0 to stop the test.
longtrain
Manufacturing test: set longtraining mode.
longtrain syntax is: longtrain <channel>
Arg is A band channel number or 0 to stop the test.
band
Returns or sets the current band
auto - auto switch between available bands (default)
a - force use of 802.11a band
b - force use of 802.11b band
bands
Return the list of available 802.11 bands
phylist
Return the list of available phytypes
shortslot
Get current 11g Short Slot Timing mode. (0=long, 1=short)
shortslot_override
Get/Set 11g Short Slot Timing mode override. (-1=auto, 0=long, 1=short)
shortslot_restrict
Get/Set AP Restriction on associations for 11g Short Slot Timing capable STAs.
0 - Do not restrict association based on ShortSlot capability
1 - Restrict association to STAs with ShortSlot capability
ignore_bcns
AP only (G mode): Check for beacons without NONERP element (0=Examine beacons, 1=Ignore beacons)
pktcnt
Get the summary of good and bad packets.
upgrade
Upgrade the firmware on an embedded device
gmode
Set the 54g Mode (LegacyB|Auto||GOnly|BDeferred|Performance|LRS)
gmode_protection
Get G protection mode. (0=disabled, 1=enabled)
gmode_protection_control
Get/Set 11g protection mode control alg. (0=always off, 1=monitor local association, 2=monitor overlapping BSS)
gmode_protection_cts
Get/Set 11g protection type to CTS (0=disable, 1=enable)
gmode_protection_override
Get/Set 11g protection mode override. (-1=auto, 0=disable, 1=enable)
legacy_erp
Get/Set 11g legacy ERP inclusion (0=disable, 1=enable)
scb_timeout
AP only: inactivity timeout value for authenticated stas
assoclist
AP only: Get the list of associated MAC addresses.
rssi
Get the current RSSI val, for an AP you must specify the mac addr of the STA
isup
Get driver operational state (0=down, 1=up)
fasttimer
Deprecated. Use fast_timer.
slowtimer
Deprecated. Use slow_timer.
glacialtimer
Deprecated. Use glacial_timer.
radar
Enable/Disable radar
radarargs
Get/Set Radar parameters in
order as npulses, ncontig, min_pw , max_pw, thresh0, thresh1
dfs_status
Get dfs status
interference
Get/Set interference mitigation mode. Choices are:
0 = none
1 = non wlan
2 = wlan manual
3 = wlan automatic
aciargs
Get/Set various aci tuning parameters. Choices are:
enter:
CRS glitch trigger level to start detecting ACI
exit:
CRS glitch trigger level to exit ACI mode
glitch
Seconds interval between ACI scans when glitchcount is continuously high
spin:
Num microsecs to delay between rssi samples
Usage: wl aciargs [enter x][exit x][spin x][glitch x]
frameburst
Disable/Enable frameburst mode
pwr_percent
Get/Set power output percentage
wet
Get/Set wireless ethernet bridging mode
bi
Get/Set the beacon period (bi=beacon interval)
dtim
Get/Set DTIM
wds_remote_mac
Get WDS link remote endpoint's MAC address
wds_wpa_role_old
Get WDS link local endpoint's WPA role (old)
wds_wpa_role
Get/Set WDS link local endpoint's WPA role
authe_sta_list
Get authenticated sta mac address list
autho_sta_list
Get authorized sta mac address list
measure_req
Send an 802.11h measurement request.
Usage: wl measure_req <type> <target MAC addr>
Measurement types are: TPC, Basic, CCA, RPI
Target MAC addr format is xx:xx:xx:xx:xx:xx
quiet
Send an 802.11h quiet command.
Usage: wl quiet <TBTTs until start>, <duration (in TUs)>, <offset (in TUs)>
csa
Send an 802.11h channel switch anouncement
Usage wl csa <mode> <when (in TBTTs)> <channel>
constraint
Send an 802.11h Power Constraint IE
Usage: wl constraint 1-255 db
rm_req
Request a radio measurement of type basic, cca, or rpi
specify a series of measurement types each followed by options.
example: wl rm_req cca -c 1 -d 50 cca -c 6 cca -c 11
Options:
-t n numeric token id for measurement set or measurement
-c n channel
-d n duration in TUs (1024 us)
-p parallel flag, measurement starts at the same time as previous
Each measurement specified uses the same channel and duration as the
previous unless a new channel or duration is specified.
rm_rep
Get current radio measurement report
join_pref
Set/Get join target preferences.
assoc_pref
Set/Get association preference.
Usage: wl assoc_pref [auto|a|b|g]
wme
Set WME (Wireless Multimedia Extensions) mode (0=off, 1=on, -1=auto)
wme_ac
wl wme_ac sta/ap [be, bk, vi, vo] [ecwmax, ecwmin, txop, aifsn, acm] value
wme_apsd
Set APSD (Automatic Power Save Delivery) mode on AP (0=off, 1=on)
wme_apsd_sta
Set APSD parameters on STA. Driver must be down.
Usage: wl wme_apsd_sta <max_sp_len> <be> <bk> <vi> <vo>
<max_sp_len>: number of frames per USP: 0 (all), 2, 4, or 6
<xx>: value 0 to disable, 1 to enable U-APSD per AC
wme_dp
Set AC queue discard policy.
Usage: wl wme_dp <be> <bk> <vi> <vo>
<xx>: value 0 for newest-first, 1 for oldest-first
wme_counters
print WMM stats
reinit
Reinitialize device
sta_info
wl sta_info <xx:xx:xx:xx:xx:xx>
cap
driver capabilities
malloc_dump
debug malloc info
chan_info
channel info
add_ie
Add a vendor proprietary IE to 802.11 management packets
Usage: wl add_ie <pktflag> length OUI hexdata
<pktflag>: Bit 0 - Beacons
Bit 1 - Probe Rsp
Bit 2 - Assoc/Reassoc Rsp
Bit 3 - Auth Rsp
Example: wl add_ie 3 10 00:90:4C 0101050c121a03
to add this IE to beacons and probe responses
del_ie
Delete a vendor proprietary IE from 802.11 management packets
Usage: wl del_ie <pktflag> length OUI hexdata
<pktflag>: Bit 0 - Beacons
Bit 1 - Probe Rsp
Bit 2 - Assoc/Reassoc Rsp
Bit 3 - Auth Rsp
Example: wl del_ie 3 10 00:90:4C 0101050c121a03
list_ie
Dump the list of vendor proprietary IEs
rand
Get a 2-byte Random Number from the MAC's PRNG
Usage: wl rand
nvotpw
Write nvram to on-chip otp
Usage: wl nvotpw file
bcmerrorstr
errorstring
freqtrack
Set Frequency Tracking Mode (0=Auto, 1=On, 2=OFF)
eventing
set/get 128-bit hex filter bitmask for MAC event reporting up to application layer
event_msgs
set/get 128-bit hex filter bitmask for MAC event reporting via packet indications
counters
Return driver counter values
assoc_info
Returns the assoc req and resp information [STA only]
autochannel
auto channel selection:
1 to issue a channel scanning;
2 to set channel based on the channel scanning result;
without argument to only show the channel selected;
ssid must set to null before this process, RF must be up
csscantimer
auto channel scan timer in minutes (0 to disable)
closed
hides the network from active scans, 0 or 1.
0 is open, 1 is hide
pmkid_info
Returns the pmkid table
abminrate
get/set afterburner minimum rate threshold
bss
set/get BSS enabled status: up/down
closednet
set/get BSS closed network attribute
diag
diag testindex(1-interrupt, 2-loopback, 3-memory, 4-led); precede by 'wl down' and follow by 'wl up'
reset_d11cnts
reset 802.11 MIB counters
Friday, October 28, 2011
Linux System Monitoring Tools
1. top - Displays dynamic real-time view of a running system
2. vmstat - Report virtual memory statistics
3. w - Show who is logged on and what they are doing.
4. uptime - Tell how long the system has been running.
5. ps - display information about the current processes.
6. free - Display amount of free and used memory in the system
7. iostat - Report CPU statistics and input/output statistics for devices and partitions.
8. sar - Collect, report, or save system activity information.
9. mpstat - Report multiprocessors related statistics.
10. pmap - report memory map of a process
11. netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
12. ss - Dump socket statistics
13. iptraf - Interactive IP traffic Monitor
14. tcpdump - Detailed Network Traffic Analysis
15. strace - Trace system calls and signals
16. /Proc file system - Process information pseudo-filesystem.
17. Nagios - Application, Services, Servers And Network Monitoring with Email and SMS alert
18. Cacti - Web-based Monitoring Tool
19. KDE System Guard - Real-time Systems Reporting and Graphing
20. Gnome System Monitor - Real-time Systems Reporting and Graphing
21. nmap - network exploration tool and security auditing.
22. lsof - list open files
23. ntop - web based network traffic probe that shows the network usage, similar to what the popular top Unix command does.
24. Conky - light-weight system monitor for X, that displays any information (uname, uptime, CPU usage, mem usage, disk usage, "top" like process stats, and network monitoring,) on your desktop.
25. GKrellM - Single process stack of system monitors that can used to monitor CPUs, Process, Disk, Network Interface, Memory, File system, Temperature, fan, voltage sensor monitors, and many other things.
26. vnstat - a console-based network traffic monitor. It keeps a log of hourly, daily and monthly network traffic for the selected interface(s).
27. htop - htop is an enhanced version of top, the interactive process viewer, which can display the list of processes in a tree form.
28. mtr - a network diagnostic tool that combines the functionality of the traceroute and ping programs.
2. vmstat - Report virtual memory statistics
3. w - Show who is logged on and what they are doing.
4. uptime - Tell how long the system has been running.
5. ps - display information about the current processes.
6. free - Display amount of free and used memory in the system
7. iostat - Report CPU statistics and input/output statistics for devices and partitions.
8. sar - Collect, report, or save system activity information.
9. mpstat - Report multiprocessors related statistics.
10. pmap - report memory map of a process
11. netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
12. ss - Dump socket statistics
13. iptraf - Interactive IP traffic Monitor
14. tcpdump - Detailed Network Traffic Analysis
15. strace - Trace system calls and signals
16. /Proc file system - Process information pseudo-filesystem.
17. Nagios - Application, Services, Servers And Network Monitoring with Email and SMS alert
18. Cacti - Web-based Monitoring Tool
19. KDE System Guard - Real-time Systems Reporting and Graphing
20. Gnome System Monitor - Real-time Systems Reporting and Graphing
21. nmap - network exploration tool and security auditing.
22. lsof - list open files
23. ntop - web based network traffic probe that shows the network usage, similar to what the popular top Unix command does.
24. Conky - light-weight system monitor for X, that displays any information (uname, uptime, CPU usage, mem usage, disk usage, "top" like process stats, and network monitoring,) on your desktop.
25. GKrellM - Single process stack of system monitors that can used to monitor CPUs, Process, Disk, Network Interface, Memory, File system, Temperature, fan, voltage sensor monitors, and many other things.
26. vnstat - a console-based network traffic monitor. It keeps a log of hourly, daily and monthly network traffic for the selected interface(s).
27. htop - htop is an enhanced version of top, the interactive process viewer, which can display the list of processes in a tree form.
28. mtr - a network diagnostic tool that combines the functionality of the traceroute and ping programs.
29. users - print the user names of users currently logged in to the current host
Wednesday, October 27, 2010
Using Passive FTP with ProFTPD
1. Edit your ProFTPD configuration file.
vi /usr/local/etc/proftpd.conf
2. Add the following lines anywhere within the section:
# Restrict the range of ports from which the server will select when
# sent the PASV command from a client. Use IANA-registered
# ephemeral port range of 49152-65534
PassivePorts 49152 65534
3. If you are running ProFTPD in standalone mode, restart ProFTPD. No further action is necessary if ProFTPD is called via inetd or xinetd.
Note: You may need to modify the IP Filter ruleset to allow passive FTP connections by allowing incoming traffic to the port range.
vi /usr/local/etc/proftpd.conf
2. Add the following lines anywhere within the section:
# Restrict the range of ports from which the server will select when
# sent the PASV command from a client. Use IANA-registered
# ephemeral port range of 49152-65534
PassivePorts 49152 65534
3. If you are running ProFTPD in standalone mode, restart ProFTPD. No further action is necessary if ProFTPD is called via inetd or xinetd.
Note: You may need to modify the IP Filter ruleset to allow passive FTP connections by allowing incoming traffic to the port range.
Monday, October 4, 2010
Getting OpenSSL to Trust the College CA
The location for certificate store for OpenSSL varies by version:
Red Hat Enterprise Linux 5: /etc/pki/tls/certs
Red Hat Enterprise Linux 4: /usr/share/ssl/certs
Fedora: /etc/pki/tls/certs
1. Change to the directory:
# cd /etc/pki/tls/certs
2. Next download the College root certificate:
# wget http://icca1.cc.ic.ac.uk/cdp/icrootca.cer
3. Create a link with the certificate hash:
# ln -s icrootca.cer `openssl x509 -hash -noout -in icrootca.cer`.0
4. You now need to repeat this for the College intermediate CA:
# wget http://icca1.cc.ic.ac.uk/cdp/icca.cer
# ln -s icca.cer `openssl x509 -hash -noout -in icca.cer`.0
The installation is now complete. You can verify that this has been successfull as follows - ensure both command return "OK":
# openssl verify -CApath /etc/pki/tls/certs icrootca.cer
icrootca.cer: OK
# openssl verify -CApath /etc/pki/tls/certs icca.cer
icca.cer: OK
Now you can connect to an SSL enabled web server that uses the College CA:
# openssl s_client -showcerts -connect icca1.cc.ic.ac.uk:443 -CApath /etc/pki/tls/certs
Ensure the resulting output displays the certifcates and gives no errors.
If you want to enable LDAPS (LDAP over SSL) under OpenLDAP, you need to repeat the above process but in /etc/openldap/cacerts (and make the appropriate changes in ldap.conf).
Reference: http://www3.imperial.ac.uk/ict/services/securitynetworkdatacentreandtelephonyservices/security/securityservices/publickeyinfrastructure/installcaonlinux
Red Hat Enterprise Linux 5: /etc/pki/tls/certs
Red Hat Enterprise Linux 4: /usr/share/ssl/certs
Fedora: /etc/pki/tls/certs
1. Change to the directory:
# cd /etc/pki/tls/certs
2. Next download the College root certificate:
# wget http://icca1.cc.ic.ac.uk/cdp/icrootca.cer
3. Create a link with the certificate hash:
# ln -s icrootca.cer `openssl x509 -hash -noout -in icrootca.cer`.0
4. You now need to repeat this for the College intermediate CA:
# wget http://icca1.cc.ic.ac.uk/cdp/icca.cer
# ln -s icca.cer `openssl x509 -hash -noout -in icca.cer`.0
The installation is now complete. You can verify that this has been successfull as follows - ensure both command return "OK":
# openssl verify -CApath /etc/pki/tls/certs icrootca.cer
icrootca.cer: OK
# openssl verify -CApath /etc/pki/tls/certs icca.cer
icca.cer: OK
Now you can connect to an SSL enabled web server that uses the College CA:
# openssl s_client -showcerts -connect icca1.cc.ic.ac.uk:443 -CApath /etc/pki/tls/certs
Ensure the resulting output displays the certifcates and gives no errors.
If you want to enable LDAPS (LDAP over SSL) under OpenLDAP, you need to repeat the above process but in /etc/openldap/cacerts (and make the appropriate changes in ldap.conf).
Reference: http://www3.imperial.ac.uk/ict/services/securitynetworkdatacentreandtelephonyservices/security/securityservices/publickeyinfrastructure/installcaonlinux
Thursday, September 23, 2010
How to change the listening port for Remote Desktop
Warning! The Remote Assistance feature in Microsoft Windows XP may not work correctly if you change the listening port.
1. Start Registry Editor.
2. Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
3. On the Edit menu, click Modify, and then click Decimal.
4. Type the new port number, and then click OK.
5. Quit Registry Editor.
1. Start Registry Editor.
2. Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
3. On the Edit menu, click Modify, and then click Decimal.
4. Type the new port number, and then click OK.
5. Quit Registry Editor.
Thursday, August 5, 2010
Clarification of changes on "allow-recursion" and "allow-query-cache" in BIND 9.4.1
Everyone upgrading from older BIND versions to BIND 9.4.1 or newer should check if this change has effects on the nameserver:
There has been some confusion surrounding the changes to the "allow-recursion" and "allow-query-cache" options made with BIND 9.4.1-P1.
This document will attempt to clarify the change and the impact that it makes on BIND servers.
In BIND 9.3, there was no segregation of queries between cache and authoritative data.
The release of BIND 9.4 added fine-grained differentiation between queries against authoritative data ("allow-query") and cached data ("allow-query-cache"). This allows more precise control, particularly if you do not want your clients to use any cached data, for example, in an authoritative-only nameserver.
Prior to the release of BIND 9.4.1-P1, the default action of "allow-recursion" and "allow-query-cache" was to permit the query. The P1 patch to BIND 9.4.1 caused two changes in this behavior:
1) If not explicitly set, the ACLs for "allow-query-cache" and "allow-recursion" were set to "localnets; localhost;".
2) If either "allow-query-cache" or "allow-recursion" was set, the other would be set the same value.
Upgrading from the BIND 9.3 branch to BIND 9.4.1-P1 will significantly restrict those servers that were previously recursive servers for more than "localhost; localnets;" unless configuration changes are made.
To retain the behavior prior to BIND 9.4.1-P1, the following entries should be created in your named.conf file:
Code:
options {
...
allow-recursion { any; };
allow-query { any; };
allow-query-cache { any; };
...
};
We strongly advise against this configuration because clients spoofing queries can use your servers to launch distributed denial-of-service attacks.
The recommended method is to create ACLs that match hosts that should be allowed access to cache and recursion on the servers. For example, if you wanted to provided recursion and access to the cache to clients you trusted, you could list them in an ACL such as the following:
Code:
acl "trusted" {
192.168.0.0/16;
10.153.154.0/24;
localhost;
localnets;
};
options {
...
allow-query { any; };
allow-recursion { trusted; };
allow-query-cache { trusted; };
...
};
This example ACL includes 192.168.0.0/16 and 10.153.154.0/24 as sample networks that would require access. You must replace these sample networks with networks that correctly reflect your environment. This will allow anyone to query your server for authoritative data, but only those hosts within the "trusted" ACL access to your cache and recursion.
Labels:
DNS,
HP-UX,
Linux/Unix,
Network,
RedHat/CentOS/Fedora,
Solaris,
Windows
Monday, July 19, 2010
การตั้งค่า firewall สำหรับ Passive FTP Connection (ตอนที่ 2)
จากบทความในตอนที่ 1 หลายๆ คนคงจะพอเข้าใจกันแล้วว่าการเชื่อมต่อ FTP แบบ Passive Mode ทำงานอย่างไร และมีความจำเป็นสำหรับ client ที่ใช้งานอินเตอร์เน็ตผ่าน NAT, Firewall หรือ Router อย่างไร แต่สิ่งสำคัญที่จะลืมไปไม่ได้ คือ การเชื่อมต่อแบบนี้เซิร์ฟเวอร์จะต้องสุ่มหมายเลขพอร์ตที่อยู่ในช่วง 1024-65535 สำหรับใช้เป็นพอร์ตรับส่งข้อมูล และส่งหมายเลขพอร์ตดังกล่าวกลับไปยังไคลเอ็นต์ ประเด็นก็คือถ้าเราใช้ Windows Firewall หรือ Firewall ใดๆ ก็ตาม ในการป้องกันการโจมตีจากผู้บุกรุก เราจะต้องกำหนด policy อย่างไร เราจะต้อง allow พอร์ต 1024-65535 เพื่อให้ Passive FTP สามารถทำงานได้อย่างไม่มีปัญหาอย่างนั้นหรือ คำตอบนี้ถูกเพียงครึ่งเดียวครับ เพราะการทำแบบนั้น หมายความว่า คุณจะต้องลดระดับความปลอดภัยของเครื่องเซิร์ฟเวอร์ของคุณ เพียงเพื่อให้สามารถเชื่อมต่อ FTP แบบ Passive Mode ได้
วิธีการที่ดีกว่านั้น ก็คือ คุณสามารถกำหนดช่วงพอร์ต หรือ port range ที่จะใช้สำหรับการเชื่อมต่อ FTP แบบ passive mode
ซึ่งจะทำให้คุณสามารถควบคุมกฎเกณฑ์และนโยบายของไฟร์วอลล์ได้ง่ายขึ้น และปลอดภัยมากขึ้น
สำหรับ IIS6 + Microsoft FTP Service บน Windows 2003 Server
• ก่อนอื่น ต้อง Enable Direct Metabase Edit ใน Internet Information Service Manager
1. เปิด Internet Information Service Manager.
2. คลิกขวาบน โนดที่เป็นชื่อของเครื่องโลคอล
3. เลือก Properties.
4. ตรวจสอบให้แน่ใจว่าได้ทำเครื่องหมายในกล่องหน้าข้อความ Enable Direct Metabase Edit checkbox เรียบร้อยแล้ว
• คอนฟิก PassivePortRange โดยใช้ ADSUTIL script
1. เปิด Command Prompt
2. พิมพ์คำสั่ง cd C:\Inetpub\AdminScripts แล้วกดปุ่ม ENTER.
3. พิมพ์คำสั่ง cscript.exe adsutil.vbs set /MSFTPSVC/PassivePortRange "5001-5201"
4. Restart เซอร์วิสที่ชื่อว่า FTP Publishing Service.
• การ allow พอร์ตที่อยู่ในช่วงของ PassivePortRange ใน Windows Firewall
1. เปิด Command Prompt
2. สมมติว่าค่า PassivePortRange คือ 5001-5201 ให้พิมพ์คำสั่งต่อไปนี้
FOR /L %I IN (5001,1,5201) DO netsh firewall add portopening TCP %I "Passive FTP"%I
3. เสร็จสิ้นกระบวนการ ลองทดสอบการใช้งาน
วิธีการที่ดีกว่านั้น ก็คือ คุณสามารถกำหนดช่วงพอร์ต หรือ port range ที่จะใช้สำหรับการเชื่อมต่อ FTP แบบ passive mode
ซึ่งจะทำให้คุณสามารถควบคุมกฎเกณฑ์และนโยบายของไฟร์วอลล์ได้ง่ายขึ้น และปลอดภัยมากขึ้น
สำหรับ IIS6 + Microsoft FTP Service บน Windows 2003 Server
• ก่อนอื่น ต้อง Enable Direct Metabase Edit ใน Internet Information Service Manager
1. เปิด Internet Information Service Manager.
2. คลิกขวาบน โนดที่เป็นชื่อของเครื่องโลคอล
3. เลือก Properties.
4. ตรวจสอบให้แน่ใจว่าได้ทำเครื่องหมายในกล่องหน้าข้อความ Enable Direct Metabase Edit checkbox เรียบร้อยแล้ว
• คอนฟิก PassivePortRange โดยใช้ ADSUTIL script
1. เปิด Command Prompt
2. พิมพ์คำสั่ง cd C:\Inetpub\AdminScripts แล้วกดปุ่ม ENTER.
3. พิมพ์คำสั่ง cscript.exe adsutil.vbs set /MSFTPSVC/PassivePortRange "5001-5201"
4. Restart เซอร์วิสที่ชื่อว่า FTP Publishing Service.
• การ allow พอร์ตที่อยู่ในช่วงของ PassivePortRange ใน Windows Firewall
1. เปิด Command Prompt
2. สมมติว่าค่า PassivePortRange คือ 5001-5201 ให้พิมพ์คำสั่งต่อไปนี้
FOR /L %I IN (5001,1,5201) DO netsh firewall add portopening TCP %I "Passive FTP"%I
3. เสร็จสิ้นกระบวนการ ลองทดสอบการใช้งาน
การตั้งค่า firewall สำหรับ Passive FTP Connection (ตอนที่ 1)
FTP เป็นเซอร์วิสที่ทำงานบนโปรโตคอล TCP/IP ในการติดต่อและรับส่งข้อมูลกับ client โดยใช้พอร์ต 2 พอร์ต คือ พอร์ตรับคำสั่ง และพอร์ตข้อมูล โหมดของ FTP สามารถแบ่งออกเป็น 2 โหมด คือ Active Mode และ Passive Mode ซึ่งจะมีการทำงานที่แตกต่างกัน

ใน active mode ของ FTP ไคลเอ็นต์จะเชื่อมต่อจากพอร์ตแบบสุ่มที่มีค่าพอร์ตมากกว่า 1023 มาที่พอร์ต 21 ของเซิร์ฟเวอร์ ซึ่งเป็นพอร์ตรับคำสั่ง (พอร์ต N>1023 จากรูปจะสมมติให้ N=1026) แล้วส่งคำสั่งซึ่งจะบอกให้เซิร์ฟเวอร์ทราบหมายเลขพอร์ตที่จะใช้ในการรับส่งข้อมูลกับเครื่องไคลเอ็นต์ (พอร์ต N+1) จากนั้นเซิร์ฟเวอร์จะตอบสนองคำสั่งโดยจะส่ง acknowledge จากพอร์ต 21 กลับไปยังพอร์ต N ของเครื่องไคลเอ็นต์ แล้วจึงทำการเชื่อมต่อจากพอร์ต 20 ซึ่งเป็นพอร์ตข้อมูลของเซิร์ฟเวอร์ไปยังพอร์จ N+1 ของเครื่องไคลเอ็นต์ ในขั้นตอนท้ายสุด ไคลเอ็นต์จะตอบสนองการเชื่อมต่อจากเซิร์ฟเวอร์โดยจะส่ง acknowledge กลับไปยังพอร์ต 20 ของเครื่องเซิร์ฟเวอร์ คำสั่งจากเครื่องไคลเอ็นต์จะส่งไปที่พอร์ต 21 ของเครื่องเซิร์ฟเวอร์ และเซิร์ฟเวอร์จะรับส่งข้อมูลกับเครื่องไคลเอ็นต์ผ่านทางพอร์ต 20
ปัญหาหลักของการทำงานในโหมดนี้ ก็คือ เครื่องไคลเอ็นต์ที่ติดตั้งไฟร์วอลล์ไว้ อาจจะไม่สามารถใช้งานได้ เนื่องจากเซิร์ฟเวอร์จะส่งข้อมูลจากพอร์ต 20 กลับไปที่พอร์ต N+1 ซึ่งพอร์ตดังกล่าวเป็นแบบสุ่ม ซึ่งโดยทั่วไปมักจะบล็อคไว้
วิธีแก้ไข คือจะต้อง allow packet ทั้งหมดที่มาจากพอร์ต 20 ของเครื่องภายนอก แต่วิธีนี้ก็อาจทำให้เกิดผลกระทบต่อความปลอดภัยภายในองค์กรอีกเช่นเดียวกัน
เพื่อแก้ปัญหาดังกล่าว จึงมีการพัฒนารูปแบบการเชื่อมต่อของ FTP ขึ้นมาอีกแบบหนึ่งซึ่งเรียกว่า Passive Mode
หลักการทำงานในโหมดนี้ ก็คือ

การทำงานในโหมดนี้จะเริ่มจากไคลเอ็นต์เชื่อมต่อจากพอร์ตแบบสุ่ม N>1023 ไปที่พอร์ต 21 ของเครื่องเซิร์ฟเวอร์ และส่งคำสั่ง PASV ไปที่เซิร์ฟเวอร์
เมื่อเซิร์ฟเวอร์ได้รับคำสั่งจะสุ่มพอร์ตสำหรับใช้เป็นพอร์ตข้อมูล สมมติให้เป็นพอร์ต P>1023 จากรูป พอร์ต P=2024 จากนั้นเซิร์ฟเวอร์จะส่งหมายเลขพอร์ต P ดังกล่าวกลับไปที่พอร์ต N ของเครื่องไคลเอ็นต์
เมื่อเครื่องไคลเอ็นต์รับทราบ ไคลเอ็นต์จะเชื่อมต่อจากพอร์ต N+1 ไปที่พอร์ต P ของเครื่องเซิร์ฟเวอร์ จากนั้นเซิร์ฟเวอร์จะส่ง Acknowledge กลับไปยังพอร์ต N+1 ของเครื่องไคลเอ็นต์ คำสั่งจากเครื่องไคลเอ็นต์จะส่งไปที่พอร์ต 21 ของเครื่องเซิร์ฟเวอร์ และเซิร์ฟเวอร์จะรับส่งข้อมูลกับไคลเอ็นต์ผ่่านทางพอร์ต P ที่เซิร์ฟเวอร์สุ่มขึ้นมา
ถึงตรงนี้ ก็คงจะเห็นภาพกันแล้วว่าใน Passive Mode การเชื่อมต่อจะเริ่มจาก client ก่อนเสมอ จึงขจัดปัญหาเรื่องไฟร์วอลล์ในส่วนของไคลเอ็นต์ไป แต่คำถามต่อมาก็คือ แล้วเซิร์ฟเวอร์ล่ะ จะควบคุมนโยบายและกฎเกณฑ์ต่างๆ ของไฟร์วอลล์ได้อย่างไร ในเมื่อพอร์ตที่ใช้เป็นพอร์ตข้อมูลเป็นพอร์ตแบบสุ่มซึ่งมากกว่า 1023 แต่เป็นพอร์ตอะไรก็ได้ จะต้อง allow ทุกพอร์ตที่มีค่ามากกว่า 1023 เลยอย่างนั้นหรือ
คำตอบ คือ ไม่จำเป็นครับ เพราะ FTP Server แต่ละค่าย ก็จะมีวิธีในการกำหนด port range ที่จะใช้ในการสุ่มเป็นพอร์ตข้อมูลในการทำงานแบบ Passive Mode อยู่แล้ว แต่วิธีการก็จะแตกต่างกันไป ตามแต่ละค่าย ทีนี้เราก็แค่ allow เฉพาะพอร์ตที่อยู่ใน port range ที่เรากำหนดไว้เท่านั้น
ใน active mode ของ FTP ไคลเอ็นต์จะเชื่อมต่อจากพอร์ตแบบสุ่มที่มีค่าพอร์ตมากกว่า 1023 มาที่พอร์ต 21 ของเซิร์ฟเวอร์ ซึ่งเป็นพอร์ตรับคำสั่ง (พอร์ต N>1023 จากรูปจะสมมติให้ N=1026) แล้วส่งคำสั่งซึ่งจะบอกให้เซิร์ฟเวอร์ทราบหมายเลขพอร์ตที่จะใช้ในการรับส่งข้อมูลกับเครื่องไคลเอ็นต์ (พอร์ต N+1) จากนั้นเซิร์ฟเวอร์จะตอบสนองคำสั่งโดยจะส่ง acknowledge จากพอร์ต 21 กลับไปยังพอร์ต N ของเครื่องไคลเอ็นต์ แล้วจึงทำการเชื่อมต่อจากพอร์ต 20 ซึ่งเป็นพอร์ตข้อมูลของเซิร์ฟเวอร์ไปยังพอร์จ N+1 ของเครื่องไคลเอ็นต์ ในขั้นตอนท้ายสุด ไคลเอ็นต์จะตอบสนองการเชื่อมต่อจากเซิร์ฟเวอร์โดยจะส่ง acknowledge กลับไปยังพอร์ต 20 ของเครื่องเซิร์ฟเวอร์ คำสั่งจากเครื่องไคลเอ็นต์จะส่งไปที่พอร์ต 21 ของเครื่องเซิร์ฟเวอร์ และเซิร์ฟเวอร์จะรับส่งข้อมูลกับเครื่องไคลเอ็นต์ผ่านทางพอร์ต 20
ปัญหาหลักของการทำงานในโหมดนี้ ก็คือ เครื่องไคลเอ็นต์ที่ติดตั้งไฟร์วอลล์ไว้ อาจจะไม่สามารถใช้งานได้ เนื่องจากเซิร์ฟเวอร์จะส่งข้อมูลจากพอร์ต 20 กลับไปที่พอร์ต N+1 ซึ่งพอร์ตดังกล่าวเป็นแบบสุ่ม ซึ่งโดยทั่วไปมักจะบล็อคไว้
วิธีแก้ไข คือจะต้อง allow packet ทั้งหมดที่มาจากพอร์ต 20 ของเครื่องภายนอก แต่วิธีนี้ก็อาจทำให้เกิดผลกระทบต่อความปลอดภัยภายในองค์กรอีกเช่นเดียวกัน
เพื่อแก้ปัญหาดังกล่าว จึงมีการพัฒนารูปแบบการเชื่อมต่อของ FTP ขึ้นมาอีกแบบหนึ่งซึ่งเรียกว่า Passive Mode
หลักการทำงานในโหมดนี้ ก็คือ
การทำงานในโหมดนี้จะเริ่มจากไคลเอ็นต์เชื่อมต่อจากพอร์ตแบบสุ่ม N>1023 ไปที่พอร์ต 21 ของเครื่องเซิร์ฟเวอร์ และส่งคำสั่ง PASV ไปที่เซิร์ฟเวอร์
เมื่อเซิร์ฟเวอร์ได้รับคำสั่งจะสุ่มพอร์ตสำหรับใช้เป็นพอร์ตข้อมูล สมมติให้เป็นพอร์ต P>1023 จากรูป พอร์ต P=2024 จากนั้นเซิร์ฟเวอร์จะส่งหมายเลขพอร์ต P ดังกล่าวกลับไปที่พอร์ต N ของเครื่องไคลเอ็นต์
เมื่อเครื่องไคลเอ็นต์รับทราบ ไคลเอ็นต์จะเชื่อมต่อจากพอร์ต N+1 ไปที่พอร์ต P ของเครื่องเซิร์ฟเวอร์ จากนั้นเซิร์ฟเวอร์จะส่ง Acknowledge กลับไปยังพอร์ต N+1 ของเครื่องไคลเอ็นต์ คำสั่งจากเครื่องไคลเอ็นต์จะส่งไปที่พอร์ต 21 ของเครื่องเซิร์ฟเวอร์ และเซิร์ฟเวอร์จะรับส่งข้อมูลกับไคลเอ็นต์ผ่่านทางพอร์ต P ที่เซิร์ฟเวอร์สุ่มขึ้นมา
ถึงตรงนี้ ก็คงจะเห็นภาพกันแล้วว่าใน Passive Mode การเชื่อมต่อจะเริ่มจาก client ก่อนเสมอ จึงขจัดปัญหาเรื่องไฟร์วอลล์ในส่วนของไคลเอ็นต์ไป แต่คำถามต่อมาก็คือ แล้วเซิร์ฟเวอร์ล่ะ จะควบคุมนโยบายและกฎเกณฑ์ต่างๆ ของไฟร์วอลล์ได้อย่างไร ในเมื่อพอร์ตที่ใช้เป็นพอร์ตข้อมูลเป็นพอร์ตแบบสุ่มซึ่งมากกว่า 1023 แต่เป็นพอร์ตอะไรก็ได้ จะต้อง allow ทุกพอร์ตที่มีค่ามากกว่า 1023 เลยอย่างนั้นหรือ
คำตอบ คือ ไม่จำเป็นครับ เพราะ FTP Server แต่ละค่าย ก็จะมีวิธีในการกำหนด port range ที่จะใช้ในการสุ่มเป็นพอร์ตข้อมูลในการทำงานแบบ Passive Mode อยู่แล้ว แต่วิธีการก็จะแตกต่างกันไป ตามแต่ละค่าย ทีนี้เราก็แค่ allow เฉพาะพอร์ตที่อยู่ใน port range ที่เรากำหนดไว้เท่านั้น
ตอนต่อไปจะกล่าวถึงวิธีการตั้งค่าไฟร์วอลล์สำหรับการทำงานในโหมด Passive FTP สำหรับ Microsoft FTP Service
การป้องกันปัญหาการ์ดแลนเสียโดยใช้เทคนิค Ethernet Bonding
คุณคงเคยเจอปัญหาการ์ดแลนของเซิร์ฟเวอร์พัง ทำให้บริการต่างๆ ของเครื่องเซิร์ฟเวอร์หยุดชะงัก การแก้ไขก็คือ คุณจะต้องรอให้ช่างเข้าไปเปลี่ยนฮาร์ดแวร์ หรือไม่ก็ต้องแก้คอนฟิกต่างๆ ของเครื่องเซิร์ฟเวอร์ เพื่อทำให้เซิร์ฟเวอร์ทำงานต่อไปได้ แต่นั่นก็หมายความว่าเซิร์ฟเวอร์ของคุณมีเวลาดาวน์เกิดขึ้นหลายชั่วโมงอย่างไม่ต้องสงสัย คุณจะมีวิธีป้องกันได้อย่างไร
คำตอบสำหรับเซิร์ฟเวอร์ที่เป็นลินุกซ์ ก็คือ คุณสามารถใช้เทคนิค Ethernet Bonding เข้ามาแก้ปัญหานี้ได้ หลักการก็คือ โดยปกติเซิร์ฟเวอร์มาตรฐานจะมีพอร์ตแลนมาให้อยู่แล้ว 2 พอร์ต แค่คุณทำให้ทั้งสองพอร์ตเข้ามาทำงานร่วมกันเสมือนว่าเป็นการ์ดแลนใบเดียวกัน ดังนั้นในเวลาที่สถานะการทำงานของเซิร์ฟเวอร์ปกติ แพ็คเกจต่างๆ ที่เข้ามาเซิร์ฟเวอร์ จะกระจายเข้าทั้งสองพอร์ตแลนอย่างสมดุล ช่วยลดปัญหาคอขวดของ TCP Buffer และทราฟฟิค แต่ถ้ามีพอร์ตใดพอร์ตหนึ่งเสีย เซิร์ฟเวอร์ก็ยังสามารถทำงานต่อไปได้ โดยไม่ต้องดาวน์ระบบ นั่นหมายถึง คุณไม่ต้องเสียงาน เสียลูกค้า เสียเครดิต
ทีนี้มาดูวิธีการติดตั้งกันดีกว่า
ในบทความนี้ขอแนะนำการคอนฟิก Ethernet Bonding เพื่อแก้ปัญหาที่อาจเกิดขึ้น โดยจะมีการจัดกลุ่มพอร์ตแลนเข้าด้วยกัน เพื่อช่วยในการรับส่งข้อมูล รูปแบบการส่งจะมีสองแบบใหญ่ๆ คือ
* Active-backup พอร์ตหนึ่งจะทำหน้าพอร์ตหลักเพื่อใช้รับส่งข้อมูล (Active) แต่อีกพอร์ตหนึ่งจะสำรอง (Backup) ไว้เฉยๆ ไม่มีการรับส่งข้อมูลใดๆ ผ่านทางพอร์ตสำรอง แต่เมื่อไรที่พอร์ตหลักมีปัญหาพอร์ตนี้จะรับส่งข้อมูลแทน สำหรับ Ethernet Bonding จะเป็นคอนฟิกใน mode 1
* Load Balance พอร์ตทั้งหมดในกลุ่มจะช่วยกันรับส่งข้อมูล ส่วนเทคนิคในการรับส่งจะมีหลายแบบด้วยกันแล้วแต่ mode ที่คอนฟิก
ในตัวอย่างจะเป็นการคอนฟิกบน Fedora 9 ซึ่งน่าจะประยุกต์ใช้กับ Fedora เวอร์ชั่นอื่นๆ, CentOS, RedHat หรือลีนุกซ์ตัวอื่นๆ ได้
เตรียมพอร์ตแลนที่จะคอนฟิกเป็น Ethernet Bonding
ในตัวอย่างจะใช้พอร์ตแลน eth2 และ eth3 เพื่อคอนฟิกรวมเป็น bond0
เริ่มต้นสร้างไฟล์ /etc/sysconfig/network-scripts/ifcfg-bond0 ซึ่งจะเป็นไฟล์คอนฟิกของ bond0 เป็นพอร์ต bonding (ในเครื่องหนึ่งสามารถจัดกลุ่มทำได้หลาย bonding พอร์ตที่คอนฟิกก็จะเป็น bond1, bond2 เป็นต้น) ในไฟล์จะมีคอนฟิก IP Address, Netmask เหมือนที่คอนฟิกพอร์ต ethernet ทั่วไป
ตัวอย่างคอนฟิก ifcfg-bond0
[root@fc9-x1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=10.1.0.1
NETMASK=255.255.255.0
BROADCAST=10.1.0.255
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
คอนฟิกพอร์ต (Physical) ให้อยู่ในกลุ่ม bond0 ตามตัวอย่าง
[root@fc9-x1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USECTL=no
[root@fc9-x1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth3
DEVICE=eth3
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USECTL=no
แก้ไขไฟล์ /etc/modprobe.conf เพื่อให้โหลด kernel module สำหรับการทำ bonding ตอนที่มีการโหลดคอนฟิก bond0
[root@fc9-x1 ~]# cat /etc/modprobe.conf
alias bond0 bonding
options bonding miimon=100 mode=1
สามารถระบุว่าจะทำ bonding เพื่อรับส่งข้อมูลแบบไหนได้จากคอนฟิก mode ดังนี้
* mode=0 (balance-rr) เป็นการส่งข้อมูลแบบ round-robin (load balancing, fault tolerance)
* mode=1 (active-backup) สถานการณ์ปกติจะมีพอร์ตเดียวเท่านั้นที่ใช้รับส่งข้อมูล (fault tolerance)
* mode=2 (balance-xor) เป็นการส่งข้อมูลแบบใช้ XOR เพื่อหาพอร์ตที่จะส่ง เช่นคำนวณจาก MAC Address ต้นทางปลายทางเป็นต้น (load balancing, fault tolerance)
* mode=3 (broadcast)
* mode=4 (802.3ad) เป็นส่งข้อมูลแบบ Link Aggregation Control Protocol (LACP) / 802.3ad
* mode=5 (balance-tlb) ส่งข้อมูลแบบ Adaptive transmit load balancing
* mode=6 (balance-alb) ส่งข้อมูลแบบ Adaptive load balancing
หมายเหตุ รายละเอียดเพิ่มเติมดูได้จากไฟล์ /usr/share/doc/kernel-doc-2.6.25/Documentation/networking/bonding.txt จาก kernel-doc-2.6.25-14.fc9.noarch.rpm
ในเริ่มต้นแนะนำให้ทดสอบกับ mode=1 เพื่อทดลอง active-backup ก่อน
หลังจากสร้างไฟล์คอนฟิกทั้งหมดแล้ว รีบูตเครื่องหนึ่งครั้ง เผื่อให้ bond0 ถูกโหลดขึ้นมา
ตรวจสอบสถานะของ Ethernet Bonding
เมื่อเครื่องบูตเสร็จเรียบร้อย ถ้าถูกต้องเมื่อรันคำสั่ง ifconfig จะมีพอร์ต bond0 เพิ่มขึ้นมาตามตัวอย่าง
[root@server ~]# ifconfig
bond0 Link encap:Ethernet HWaddr 00:0C:22:FF:11:55
inet addr:10.1.0.1 Bcast:10.1.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:13 errors:0 dropped:0 overruns:0 frame:0
TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1160 (1.1 KiB) TX bytes:1574 (1.5 KiB)
...
eth2 Link encap:Ethernet HWaddr 00:0C:22:FF:11:55
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1100 (1.0 KiB) TX bytes:1574 (1.5 KiB)
Interrupt:16 Base address:0x1824
eth3 Link encap:Ethernet HWaddr 00:0C:22:FF:11:55
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:60 (60.0 b) TX bytes:0 (0.0 b)
Interrupt:17 Base address:0x18a4
ข้อสังเกตจากคำสั่ง ifconfig
* HWaddr หรือ MAC Address ของแต่ละพอร์ตที่ทำ bonding ด้วยกันจะเป็นค่าเดียวกันหมด ทั้งนี้เพื่อประโยชน์ในการทำ fail over
* ในโหมด active-backup ปกติจะมีพอร์ตเดียวทำหน้าที่เป็นหลักใช้ในการรับส่งข้อมูล ซึ่งดูได้จากค่า RX, TX packets
หากต้องการรู้ว่าพอร์ตไหนถูกใช้เป็นหลัก (active) ในการส่งข้อมูล สามารถดูได้จากไฟล์ /proc/net/bonding/bond0
ตัวอย่างไฟล์ /proc/net/bonding/bond0
[root@fc9-x1 ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.2.5 (March 21, 2008)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth2
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth2
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:22:ff:11:55
Slave Interface: eth3
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:22:ff:11:56
จากตัวอย่างพอร์ตหลักที่ถูกใช้ในโหมด (active-backup) คือพอร์ต eth2 ดูได้จาก Currently Active Slave: eth2
ทดสอบการ fail over
แนะนำว่าก่อนที่จะดึงสายแลนให้รันคำสั่ง ping ทิ้งไว้ เพื่อดูว่าเวลาที่มีการ fail over จะยังส่งข้อมูลต่อไปได้เลยไหม
ทดลองดึงสายออกจากพอร์ต eth2 แล้วตรวจสอบไฟล์ /proc/net/bonding/bond0 อีกครั้ง จะเห็นว่าพอร์ต eth3 จะถูกนำมาใช้เป็นหลักในการรับส่งข้อมูลแทน แล้วคำสั่ง ping ก็ยังคงทำงานอยู่ อาจมีสะดุดไปบ้างเล็กน้อย
[root@fc9-x1 ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.2.5 (March 21, 2008)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth3
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth2
MII Status: down
Link Failure Count: 1
Permanent HW addr: 00:0c:22:ff:11:55
Slave Interface: eth3
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:22:ff:11:56
จากผลลัพธ์จะแสดงสถานะของ bonding ต่างๆ ดังนี้
* Currently Active Slave: eth3 พอร์ตหลักที่ใช้รับส่งข้อมูลตอนนี้
* Slave Interface: eth2, MII Status: down สถานะของพอร์ต eth2 down
* Link Failur Count: 1 แสดงตัวเลขจำนวนครั้งที่พอร์ตมีปัญหา
สุดท้ายทดสอบด้วยการเสียบสายกลับเข้าไปที่พอร์ตที่ 2 จะเห็นว่าไม่มีการ fail over กลับมาที่พอร์ต eth2 พอร์ต eth3 จะยังคงเป็นหลักในการรับส่งข้อมูลอยู่
คำตอบสำหรับเซิร์ฟเวอร์ที่เป็นลินุกซ์ ก็คือ คุณสามารถใช้เทคนิค Ethernet Bonding เข้ามาแก้ปัญหานี้ได้ หลักการก็คือ โดยปกติเซิร์ฟเวอร์มาตรฐานจะมีพอร์ตแลนมาให้อยู่แล้ว 2 พอร์ต แค่คุณทำให้ทั้งสองพอร์ตเข้ามาทำงานร่วมกันเสมือนว่าเป็นการ์ดแลนใบเดียวกัน ดังนั้นในเวลาที่สถานะการทำงานของเซิร์ฟเวอร์ปกติ แพ็คเกจต่างๆ ที่เข้ามาเซิร์ฟเวอร์ จะกระจายเข้าทั้งสองพอร์ตแลนอย่างสมดุล ช่วยลดปัญหาคอขวดของ TCP Buffer และทราฟฟิค แต่ถ้ามีพอร์ตใดพอร์ตหนึ่งเสีย เซิร์ฟเวอร์ก็ยังสามารถทำงานต่อไปได้ โดยไม่ต้องดาวน์ระบบ นั่นหมายถึง คุณไม่ต้องเสียงาน เสียลูกค้า เสียเครดิต
ทีนี้มาดูวิธีการติดตั้งกันดีกว่า
ในบทความนี้ขอแนะนำการคอนฟิก Ethernet Bonding เพื่อแก้ปัญหาที่อาจเกิดขึ้น โดยจะมีการจัดกลุ่มพอร์ตแลนเข้าด้วยกัน เพื่อช่วยในการรับส่งข้อมูล รูปแบบการส่งจะมีสองแบบใหญ่ๆ คือ
* Active-backup พอร์ตหนึ่งจะทำหน้าพอร์ตหลักเพื่อใช้รับส่งข้อมูล (Active) แต่อีกพอร์ตหนึ่งจะสำรอง (Backup) ไว้เฉยๆ ไม่มีการรับส่งข้อมูลใดๆ ผ่านทางพอร์ตสำรอง แต่เมื่อไรที่พอร์ตหลักมีปัญหาพอร์ตนี้จะรับส่งข้อมูลแทน สำหรับ Ethernet Bonding จะเป็นคอนฟิกใน mode 1
* Load Balance พอร์ตทั้งหมดในกลุ่มจะช่วยกันรับส่งข้อมูล ส่วนเทคนิคในการรับส่งจะมีหลายแบบด้วยกันแล้วแต่ mode ที่คอนฟิก
ในตัวอย่างจะเป็นการคอนฟิกบน Fedora 9 ซึ่งน่าจะประยุกต์ใช้กับ Fedora เวอร์ชั่นอื่นๆ, CentOS, RedHat หรือลีนุกซ์ตัวอื่นๆ ได้
เตรียมพอร์ตแลนที่จะคอนฟิกเป็น Ethernet Bonding
ในตัวอย่างจะใช้พอร์ตแลน eth2 และ eth3 เพื่อคอนฟิกรวมเป็น bond0
เริ่มต้นสร้างไฟล์ /etc/sysconfig/network-scripts/ifcfg-bond0 ซึ่งจะเป็นไฟล์คอนฟิกของ bond0 เป็นพอร์ต bonding (ในเครื่องหนึ่งสามารถจัดกลุ่มทำได้หลาย bonding พอร์ตที่คอนฟิกก็จะเป็น bond1, bond2 เป็นต้น) ในไฟล์จะมีคอนฟิก IP Address, Netmask เหมือนที่คอนฟิกพอร์ต ethernet ทั่วไป
ตัวอย่างคอนฟิก ifcfg-bond0
[root@fc9-x1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=10.1.0.1
NETMASK=255.255.255.0
BROADCAST=10.1.0.255
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
คอนฟิกพอร์ต (Physical) ให้อยู่ในกลุ่ม bond0 ตามตัวอย่าง
[root@fc9-x1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USECTL=no
[root@fc9-x1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth3
DEVICE=eth3
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USECTL=no
แก้ไขไฟล์ /etc/modprobe.conf เพื่อให้โหลด kernel module สำหรับการทำ bonding ตอนที่มีการโหลดคอนฟิก bond0
[root@fc9-x1 ~]# cat /etc/modprobe.conf
alias bond0 bonding
options bonding miimon=100 mode=1
สามารถระบุว่าจะทำ bonding เพื่อรับส่งข้อมูลแบบไหนได้จากคอนฟิก mode ดังนี้
* mode=0 (balance-rr) เป็นการส่งข้อมูลแบบ round-robin (load balancing, fault tolerance)
* mode=1 (active-backup) สถานการณ์ปกติจะมีพอร์ตเดียวเท่านั้นที่ใช้รับส่งข้อมูล (fault tolerance)
* mode=2 (balance-xor) เป็นการส่งข้อมูลแบบใช้ XOR เพื่อหาพอร์ตที่จะส่ง เช่นคำนวณจาก MAC Address ต้นทางปลายทางเป็นต้น (load balancing, fault tolerance)
* mode=3 (broadcast)
* mode=4 (802.3ad) เป็นส่งข้อมูลแบบ Link Aggregation Control Protocol (LACP) / 802.3ad
* mode=5 (balance-tlb) ส่งข้อมูลแบบ Adaptive transmit load balancing
* mode=6 (balance-alb) ส่งข้อมูลแบบ Adaptive load balancing
หมายเหตุ รายละเอียดเพิ่มเติมดูได้จากไฟล์ /usr/share/doc/kernel-doc-2.6.25/Documentation/networking/bonding.txt จาก kernel-doc-2.6.25-14.fc9.noarch.rpm
ในเริ่มต้นแนะนำให้ทดสอบกับ mode=1 เพื่อทดลอง active-backup ก่อน
หลังจากสร้างไฟล์คอนฟิกทั้งหมดแล้ว รีบูตเครื่องหนึ่งครั้ง เผื่อให้ bond0 ถูกโหลดขึ้นมา
ตรวจสอบสถานะของ Ethernet Bonding
เมื่อเครื่องบูตเสร็จเรียบร้อย ถ้าถูกต้องเมื่อรันคำสั่ง ifconfig จะมีพอร์ต bond0 เพิ่มขึ้นมาตามตัวอย่าง
[root@server ~]# ifconfig
bond0 Link encap:Ethernet HWaddr 00:0C:22:FF:11:55
inet addr:10.1.0.1 Bcast:10.1.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:13 errors:0 dropped:0 overruns:0 frame:0
TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1160 (1.1 KiB) TX bytes:1574 (1.5 KiB)
...
eth2 Link encap:Ethernet HWaddr 00:0C:22:FF:11:55
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1100 (1.0 KiB) TX bytes:1574 (1.5 KiB)
Interrupt:16 Base address:0x1824
eth3 Link encap:Ethernet HWaddr 00:0C:22:FF:11:55
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:60 (60.0 b) TX bytes:0 (0.0 b)
Interrupt:17 Base address:0x18a4
ข้อสังเกตจากคำสั่ง ifconfig
* HWaddr หรือ MAC Address ของแต่ละพอร์ตที่ทำ bonding ด้วยกันจะเป็นค่าเดียวกันหมด ทั้งนี้เพื่อประโยชน์ในการทำ fail over
* ในโหมด active-backup ปกติจะมีพอร์ตเดียวทำหน้าที่เป็นหลักใช้ในการรับส่งข้อมูล ซึ่งดูได้จากค่า RX, TX packets
หากต้องการรู้ว่าพอร์ตไหนถูกใช้เป็นหลัก (active) ในการส่งข้อมูล สามารถดูได้จากไฟล์ /proc/net/bonding/bond0
ตัวอย่างไฟล์ /proc/net/bonding/bond0
[root@fc9-x1 ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.2.5 (March 21, 2008)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth2
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth2
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:22:ff:11:55
Slave Interface: eth3
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:22:ff:11:56
จากตัวอย่างพอร์ตหลักที่ถูกใช้ในโหมด (active-backup) คือพอร์ต eth2 ดูได้จาก Currently Active Slave: eth2
ทดสอบการ fail over
แนะนำว่าก่อนที่จะดึงสายแลนให้รันคำสั่ง ping ทิ้งไว้ เพื่อดูว่าเวลาที่มีการ fail over จะยังส่งข้อมูลต่อไปได้เลยไหม
ทดลองดึงสายออกจากพอร์ต eth2 แล้วตรวจสอบไฟล์ /proc/net/bonding/bond0 อีกครั้ง จะเห็นว่าพอร์ต eth3 จะถูกนำมาใช้เป็นหลักในการรับส่งข้อมูลแทน แล้วคำสั่ง ping ก็ยังคงทำงานอยู่ อาจมีสะดุดไปบ้างเล็กน้อย
[root@fc9-x1 ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.2.5 (March 21, 2008)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth3
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth2
MII Status: down
Link Failure Count: 1
Permanent HW addr: 00:0c:22:ff:11:55
Slave Interface: eth3
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:22:ff:11:56
จากผลลัพธ์จะแสดงสถานะของ bonding ต่างๆ ดังนี้
* Currently Active Slave: eth3 พอร์ตหลักที่ใช้รับส่งข้อมูลตอนนี้
* Slave Interface: eth2, MII Status: down สถานะของพอร์ต eth2 down
* Link Failur Count: 1 แสดงตัวเลขจำนวนครั้งที่พอร์ตมีปัญหา
สุดท้ายทดสอบด้วยการเสียบสายกลับเข้าไปที่พอร์ตที่ 2 จะเห็นว่าไม่มีการ fail over กลับมาที่พอร์ต eth2 พอร์ต eth3 จะยังคงเป็นหลักในการรับส่งข้อมูลอยู่
ทำไมลูกค้า Maxnet ส่งเมล์ผ่าน Outlook ไม่ได้
สาเหตุก็ง่ายๆ เลยครับ เนื่องจากการส่งอีเมล์ผ่านโปรแกรม mail client เช่น Outlook Express หรือ Microsoft Outlook โดยทั่วไปถ้าไม่มีการตั้งค่าใดๆ เพิ่มเติม จะใช้พอร์ต 25 สำหรับการส่งเมล์ แต่ Maxnet จะบล็อคพอร์ต 25 ทำให้เราไม่สามารถติดต่อกับ smtp server ผ่านพอร์ตมาตรฐานที่ทั่วโลกใช้กันได้
สำหรับวิธีแก้ไขก็มีอยู่ 2 แบบ คือ
1. ใช้ smtp server (Outgoing Mail Server) ที่ทาง maxnet จัดเตรียมไว้ให้ คือ smtp.tttmaxnet.com (อันนี้เป็นคำตอบของทีมเทคนิคของ maxnet ซึ่งผมลองมาแล้วก็ไม่เวิร์คเหมือนกันครับ)
2. ถ้าคุณเป็นแอดมิน หรือสามารถติดต่อกับแอดมินของระบบเมล์ของบริษัทของคุณได้ ให้ทำการเพิ่ม listen port อื่นๆ ที่ไม่ใช่พอร์ต 25 สำหรับการเมล์ขาเข้า ขอย้ำ !!! เพิ่มนะครับ ไม่ใช่เปลี่ยน เพราะยังจำเป็นจะต้องใช้พอร์ต 25 ในการรับเมล์จากเซิร์ฟเวอร์ทั่วไป ที่สำคัญ ให้ระวัง พอร์ตที่เพิ่มเข้าไปจะต้องไม่ซ้ำกับพอร์ตมาตรฐานของ service อื่นที่ใช้งานอยู่ ในกรณีนี้ ผมทดสอบแล้ว เวิร์คแน่นอนครับ แต่ในการใช้งาน จะต้องตั้งค่าใน mail client โดยกำหนด SMTP Port เป็นพอร์ตที่เราเพิ่มเข้าไปแทนพอร์ต 25 ครับ
สำหรับวิธีแก้ไขก็มีอยู่ 2 แบบ คือ
1. ใช้ smtp server (Outgoing Mail Server) ที่ทาง maxnet จัดเตรียมไว้ให้ คือ smtp.tttmaxnet.com (อันนี้เป็นคำตอบของทีมเทคนิคของ maxnet ซึ่งผมลองมาแล้วก็ไม่เวิร์คเหมือนกันครับ)
2. ถ้าคุณเป็นแอดมิน หรือสามารถติดต่อกับแอดมินของระบบเมล์ของบริษัทของคุณได้ ให้ทำการเพิ่ม listen port อื่นๆ ที่ไม่ใช่พอร์ต 25 สำหรับการเมล์ขาเข้า ขอย้ำ !!! เพิ่มนะครับ ไม่ใช่เปลี่ยน เพราะยังจำเป็นจะต้องใช้พอร์ต 25 ในการรับเมล์จากเซิร์ฟเวอร์ทั่วไป ที่สำคัญ ให้ระวัง พอร์ตที่เพิ่มเข้าไปจะต้องไม่ซ้ำกับพอร์ตมาตรฐานของ service อื่นที่ใช้งานอยู่ ในกรณีนี้ ผมทดสอบแล้ว เวิร์คแน่นอนครับ แต่ในการใช้งาน จะต้องตั้งค่าใน mail client โดยกำหนด SMTP Port เป็นพอร์ตที่เราเพิ่มเข้าไปแทนพอร์ต 25 ครับ
วิธีการเลี่ยงพอร์ตแบบนี้ นอกจากจะใช้กับ SMTP แล้ว อาจนำไปประยุกต์ใช้กับระบบหรือโปรแกรมอื่นๆ ที่โดนบล็อคพอร์ตได้อีกด้วยนะครับ
Subscribe to:
Posts (Atom)