Thứ Hai, 5 tháng 5, 2014
freshinstall on Centos
cent5repo()
{
yum -y groupinstall "Development Tools"
yum -y install wget
wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-0.5.2-2.el5.rf.*.rpm
rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm
}
cent6repo()
{
yum -y groupinstall "Development Tools"
yum -y install wget
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
}
installbase()
{
yum install -y ntp.x86_64 nc.x86_64 tcpdump.x86_64
}
vntimezone()
{
rm -rf /etc/localtime;
cp /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime;
/etc/init.d/ntpd stop; ntpdate 0.centos.pool.ntp.org; /etc/init.d/ntpd start
}
disselinux()
{
echo "SELINUX=disabled" > /etc/selinux/config; echo "SELINUXTYPE=targeted" >> /etc/selinux/config; setenforce 0
}
mkbasedir()
{
mkdir -p /ssg/script /data /source /report/output /report/shell_log
chmod 777 /report/shell_log
}
shellogging()
{
echo 'DATE=`date +%d-%m-%y.%H:%M:%S`' >> /etc/profile
echo "USERL=`whoami`" >> /etc/profile
echo 'touch /report/shell_log/$USERL.$DATE' >> /etc/profile
echo 'FILE_LOGGING=/report/shell_log/$USERL.$DATE' >> /etc/profile
echo 'script -q -a -f $FILE_LOGGING' >> /etc/profile
}
sshkeyconfig()
{
if [ ! -d /root/.ssh ]; then
mkdir /root/.ssh
chmod 755 /root/.ssh
fi
if [ -f /root/.ssh/authorized_keys ]; then
mv /root/.ssh/authorized_keys /root/.ssh/authorized_keys.bk
fi
cp authorized_keys /root/.ssh/authorized_keys
chmod 0600 /root/.ssh/authorized_keys
cp -r tunnel_keys /root/.ssh/
chmod 755 /root/.ssh/tunnel_keys
chmod 0600 /root/.ssh/tunnel_keys/tunnel_key.dsa
}
sshdconfig()
{
mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bk
cp sshd_config /etc/ssh/
/etc/init.d/sshd restart
}
if [ "$1" = "centos5" ]; then
echo xxxxxx cent5repo
cent5repo
echo xxxxxx disselinux
disselinux
echo xxxxxx installbase
installbase
echo xxxxxx vntimezone
vntimezone
echo xxxxxx mkbasedir
mkbasedir
echo xxxxxx shellogging
shellogging
echo xxxxxx sshdconfig
sshdconfig
echo xxxxxx sshkeyconfig
sshkeyconfig
elif [ "$1" = "centos6" ]; then
echo xxxxxx cent5repo
cent5repo
echo xxxxxx disselinux
disselinux
echo xxxxxx installbase
installbase
echo xxxxxx vntimezone
vntimezone
echo xxxxxx mkbasedir
mkbasedir
echo xxxxxx shellogging
shellogging
echo xxxxxx sshdconfig
sshdconfig
echo xxxxxx sshkeyconfig
sshkeyconfig
elif [ "$1" = "--help" -o "$1" = "" ]; then
echo '
run ./freshinstall.sh {option} or ./freshintall.sh --help
option:
centos5: if you want to install for centos5.x
centos6: if you want to install for centos6.x
'
fi
AD Authentication with RHEL 6
AD Authentication with RHEL 6
We’ve
been using AD authentication with our RHEL and CENTOS 4 and 5 systems
for some time, now, so I was anxious to see what kinds of changes might
have come up with RHEL6. Not much, happily, but there was one change
that took a little while to figure out. We’ll run through all the
steps, from beginning to end, here.
Depending on your DNS configuration, you might get some errors like the following:
Once you’ve joined the domain, we need to start winbind
There are two lines in the /etc/oddjobd.conf.d/oddjobd-mkhomedir.conf file that look like this:
There's a curiousity with the way oddjobd works, here: it seems to be assuming that the default umask is 0022 (644 permissions equivalent). When we change the umask 0077 (700), it not only creates the users' home directories with these permissions, but *also the domain home*. As it turns out, the domain home (/home/DOMAIN) is owned by root. This prevents anyone from being able to get to their home directory.
Unless we change this, users will receive the following error:
There's a bug for this behavior, BTW, at https://bugzilla.redhat.com/show_bug.cgi?id=666418, if you're interested in such things.
This should set you up so that everyone can change directories to this, but no one can read or write to this directory. If you prefer users to be able to enumerate the contents of your DOMAIN directory, change the permissions to 755 instead of 711.
Domain authentication isn’t that useful unless you can use it to control who can and cannot log in to your server.
It’s possible to put login restrictions here in the system-auth file, but it’s usually considered best practices to put those in the individual files for the connection methods. We’ll do that now.
Install the prerequisites
We’re using samba and samba-winbind for this, so make sure these are installed.
yum install samba samba-winbind
If you’re running RHEL5 and a Windows 2008 R2 domain, you’ll want to use samba3x, instead of the samba. See this article for more information on that front.Edit the Configuration Files
you’ll want to have the following settings. I’ve grouped them here to make it all more readable. Changes from the default are in blue./etc/krb5.conf
default_realm = EXAMPLE.COM
dns_lookup_realm = true
dns_lookup_kdc = true
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = yes
[realms]
EXAMPLE.COM = {
default_domain = example.com
}
[domain_realm]
.example.com = EXAMPLE.COM
example.com = EXAMPLE.COM
Here we’re defining the kerberos realm and domains. “example.com” will
be replaced with your AD domain name. Do note the capitalization; it
matters./etc/samba/smb.conf
workgroup = example
realm = EXAMPLE.COM
security = ads
idmap uid = 10000-500000
idmap gid = 10000-500000
template shell = /bin/bash
winbind use default domain = true
winbind offline logon = false
winbind nested groups = yes
encrypt passwords = yes
Here we’ve told samba to use the kerberos realm EXAMPLE.COM (you’ll
substitute your domain from the krb5.conf file). We’re using ads for
security (Windows-style), and we’re allocating a bunch of UIDs and GIDs
for mapping the domain users and groups to the Linux equivalents./etc/nsswitch.conf
passwd: files winbind
shadow: files
group: files winbind
Here we’re telling the system to look not only in the /etc/passwd and
/etc/group files for authentication, but also to use winbind.Join the Domain
Now’s the fun part: we can join the system to the domain.
chkconfig smb on
service smb restart
net ads join –U username
where username is a domain user who has permissions to join a
computer to the domain. You should get a response that the server has
joined your realm.Depending on your DNS configuration, you might get some errors like the following:
[root@linuxserver1]# net ads join -U username
Enter username's password:
Using short domain name – EXAMPLE
Joined 'LINUXSERVER1' to realm 'example.com'
[2010/11/29 16:11:20.643445, 0]
libads/kerberos.c:333(ads_kinit_password) kerberos_kinit_password
LINUXSERVER1$@EXAMPLE.COM failed: Client not found in Kerberos database
[2010/11/29 16:11:20.644894, 0]
utils/net_ads.c:1147(net_update_dns_internal) net_update_dns_internal:
Failed to connect to our DC! DNS update failed!
So long as your server created a machine account in the domain, you can
ignore the above errors. It’s trying to update your DNS server, and if
you’re not using a Microsoft DNS server as a part of your domain, it
will fail. That’s OK.Once you’ve joined the domain, we need to start winbind
chkconfig winbind on
service winbind start
Assuming winbind starts without any errors, you can test your membership and domain communication with the wbinfo command:
wbinfo –g
This command should list out all of the groups you’ve got configured in your domain. Configure the home directories
We’ll first want to edit the /etc/oddjobd.conf.d/oddjobd-mkhomedir.conf file; this defaults to creating home directories that are group- and world-readable. We don’t want that. This, BTW, is a change from what we did in RHEL 5 and below.There are two lines in the /etc/oddjobd.conf.d/oddjobd-mkhomedir.conf file that look like this:
<helper exec="/usr/libexec/oddjob/mkhomedir -u 0022"
Change them to read:
<helper exec="/usr/libexec/oddjob/mkhomedir -u 0077"
Then restart the oddjobd service
service oddjobd restart
Set the domain home permissions
*Note: the behavior below is reported as fixed in advisory RHBA-2011:0339-2, but I'm leaving the information here for posterity's sake.There's a curiousity with the way oddjobd works, here: it seems to be assuming that the default umask is 0022 (644 permissions equivalent). When we change the umask 0077 (700), it not only creates the users' home directories with these permissions, but *also the domain home*. As it turns out, the domain home (/home/DOMAIN) is owned by root. This prevents anyone from being able to get to their home directory.
Unless we change this, users will receive the following error:
Could not chdir to home directory /home/DOMAIN/user: Permission denied
-bash: /home/DOMAIN/user/.bash_profile: Permission denied
But if we pre-create the domain home, we should be in good shape:
mkdir /home/DOMAIN
chmod 711 /home/DOMAIN
Where DOMAIN is the short name of your AD domain.There's a bug for this behavior, BTW, at https://bugzilla.redhat.com/show_bug.cgi?id=666418, if you're interested in such things.
This should set you up so that everyone can change directories to this, but no one can read or write to this directory. If you prefer users to be able to enumerate the contents of your DOMAIN directory, change the permissions to 755 instead of 711.
Restrict Logins
We’ll first edit the /etc/pam.d/password-auth file (you can have the OS do this with a GUI front-end for you, if you run authconfig-gtk). This tells pam to use, in addition to the local user store, winbind for authentication.Domain authentication isn’t that useful unless you can use it to control who can and cannot log in to your server.
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth sufficient pam_unix.so nullok try_first_pass
auth requisite pam_succeed_if.so uid >= 500 quiet
auth sufficient pam_winbind.so use_first_pass
auth required pam_deny.so
account required pam_unix.so broken_shadow
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 500 quiet
account [default=bad success=ok user_unknown=ignore] pam_winbind.so
account required pam_permit.so
password requisite pam_cracklib.so try_first_pass retry=3 type=
password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password sufficient pam_winbind.so use_authtok
password required pam_deny.so
session optional pam_keyinit.so revoke
session required pam_limits.so
session optional pam_oddjob_mkhomedir.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so
The mkhomedir line has PAM create a home directory (defaulting to /home/DOMAIN/username). That’s usually a good idea.It’s possible to put login restrictions here in the system-auth file, but it’s usually considered best practices to put those in the individual files for the connection methods. We’ll do that now.
/etc/pam.d/sshd
#%PAM-1.0
auth required pam_sepermit.so
auth include password-auth
auth include system-auth
account required pam_nologin.so
account include system-auth
account sufficient pam_localuser.so
account required pam_succeed_if.so user ingroup DOMAIN\linuxadmins
password include system-auth
# pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session required pam_loginuid.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session required pam_selinux.so open env_params
session optional pam_keyinit.so force revoke
session include password-auth
Here we’re telling pam that only users who are in the group linuxadmins are allowed to connect to our server though ssh./etc/pam.d/gdm
#%PAM-1.0
auth [success=done ignore=ignore default=bad] pam_selinux_permit.so
auth required pam_succeed_if.so user != root quiet
auth required pam_env.so
auth substack system-auth
auth optional pam_gnome_keyring.so
account required pam_nologin.so
account include system-auth
account sufficient pam_succeed_if.so user = DOMAIN\user34
account sufficient pam_succeed_if.so user ingroup DOMAIN\linuxadmins
account required pam_succeed_if.so user ingroup DOMAIN\domainadmins
password include system-auth
session required pam_selinux.so close
session required pam_loginuid.so
session optional pam_console.so
session required pam_selinux.so open
session optional pam_keyinit.so force revoke
session required pam_namespace.so
session optional pam_gnome_keyring.so auto_start
session include system-auth
We’re giving more people access to the GUI login, though. Notice that
we’re allowing user34, linuxadmins, and domainadmins to log in through
GDM.
Posted 30th November 2010 by Lane Duncan
Remove email special from mailbox exchange
#Remove email special from mailbox exchange
#Create new mailbox "TempMailbox", after create new folder in TempMailBox is "Demo"
#Open Exchange management Shell command type :
Add-MailboxPermission -User wgroot@ssgroup.com.vn -AccessRights FullAccess -Identity xxx
Export-Mailbox -Identity xxx@ssgroup.com.vn -SenderKeywords "xxxx@hotmail.com" -TargetMailbox yyyy@ssgroup.com.vn -DeleteContent -TargetFolder Demo
#Create new mailbox "TempMailbox", after create new folder in TempMailBox is "Demo"
#Open Exchange management Shell command type :
Add-MailboxPermission -User wgroot@ssgroup.com.vn -AccessRights FullAccess -Identity xxx
Export-Mailbox -Identity xxx@ssgroup.com.vn -SenderKeywords "xxxx@hotmail.com" -TargetMailbox yyyy@ssgroup.com.vn -DeleteContent -TargetFolder Demo
Lệnh tcpdump trên Linux
Lệnh tcpdump trên Linux
/ k3nshjnz
Tcpdump xuất ra màn hình nội dung các gói tin (chạy trên card mạng mà nó đang lắng nghe) phù hợp với biểu thức logic chọn lọc mà người dùng nhập vào. Với option –w người dùng có thể xuất những mô tả về gói tin này ra một file “pcap” để phân tích sau, và có thể đọc nội dung của file “pcap” đó với option –r của lệnh tcpdump, hoặc sử dụng các phần mềm khác như là : Wireshark.
Trong trường hợp không có option –c, lệnh tcpdump sẽ tiếp tục chạy cho đến khi nào nó nhận được một tín hiệu ngắt từ phía người dùng (có thể sử dụng tổ hợp phím ctrl+C hoặc sử dụng lệnh kill). Sau khi kết thúc việc bắt các gói tin, tcpdump sẽ báo cáo các cột sau:
- Packet capture: số lượng gói tin mà nó bắt được và xử lý.
- Packet received by filter: số lượng gói tin được nhận bởi bộ lọc.
- Packet dropped by kernel: số lượng packet đã bị dropped, do thiếu không gian vùng đệm, bởi cơ chế bắt gói tin của hệ điều hành.
time-stamp src > dst: flags data-seqno ack window urgent options
- Time-stamp: hiển thị thời gian gói tin được capture.
- Src và dst: hiển thị địa IP của người gởi và người nhận.
- Cờ Flag thì bao gồm các giá trị sau:
- S(SYN): cờ này được sử dụng trong quá trình bắt tay của giao thức TCP.
- .(ACK): cờ này được sử dụng để thông báo cho bên gửi biết là nó đã nhận được dữ liệu thành công.
- F(FIN): được sử dụng để đóng kết nối TCP.
- P(PUSH): thường được đặt ở cuối khối dữ liệu, đánh dấu việc truyền dữ liệu.
- R(RST): được sử dụng khi muốn thiết lập lại đường truyền.
- Data-sqeno: số sequence number của gói dữ liệu hiện tại.
- ACK: mô tả số sequence number tiếp theo của gói tin do bên gởi truyền (số sequence number mà nó mong muốn nhận được).
- Window: vùng nhớ đệm có sẵn theo hướng khác trên kết nối này.
- Urgent: cho biết có dữ liệu khẩn cấp trong gói tin.
- -i : sử dụng option này khi người dùng muốn chụp các gói tin trên một interface được chỉ định.
- -D : khi sử dụng option này, tcpdump sẽ liệt kê ra tất cả các interface đang hiện hữu trên máy tính mà nó có thể capture được.
- -c N : khi sử dụng option này, tcpdump sẽ dừng hoạt động sau khi capture N gói tin.
- -n : khi sử dụng option này, tcpdump sẽ không phân giải từ địa chỉ IP sang hostname.
- -nn : tương tự như option –n, tuy nhiên tcpdump sẽ không phân giải cả portname.
- -v : tăng số lượng thông tin về gói tin mà bạn có thể nhận được, thậm chí có thể tăng thêm với option –vv hoặc –vvv.
- -s : định nghĩa snaplength (kích thước) gói tin sẽ lưu lại, sử dụng 0 để mặc định.
- -q : khi sử dụng option này thì lệnh tcpdump sẽ hiển thị ít thông tin hơn.
- -w filename : khi sử dụng option này tcpdump sẽ capture các packet và lưu xuống file chỉ định.
- -r filename : sử dụng kèm với option –w, dùng để đọc nội dung file đã lưu từ trước.
- -x : hiển thị dữ liệu của gói tin capture dưới dạng mã Hex.
- -xx : tương tự option –x tuy nhiên sẽ chuyển đổi cả ethernet header.
- -X : hiển thị dữ liệu của gói tin capture dưới dạng mã Hex và ASCII
- -XX : tương tự như option –X tuy nhiên sẽ chuyển đổi luôn cả ethernet header.
- -A : hiển thị các packet được capture dưới dạng mã ACSII.
- -S : khi tcpdump capture packet, thì nó sẽ chuyển các số sequence number, ACK thành các relative sequense number, relative ACK. Nếu sử dụng option –S này thì nó sẽ không chuyển mà sẽ để mặc định.
- -F filename: dùng để filter các packet với các luật đã được định trước trong tập tin filename.
- -e : khi sử dụng option này, thay thì hiển thị địa chỉ IP của người gửi và người nhận, tcpdump sẽ thay thế các địa chỉ này bằng địa chỉ MAC.
- -t : khi sử dụng option này, tcpdump sẽ bỏ qua thời gian bắt được gói tin khi hiển thị cho người dùng.
- -tt : khi sử dụng option này, thời gian hiển thị trên mỗi dòng lệnh sẽ không được format theo dạng chuẩn.
- -ttt : khi sử dụng option này, thời gian hiển thị chính là thời gian chênh lệnh giữa thời gian tcpdump bắt được gói tin của gói tin và gói tin đến trước nó.
- -tttt : khi sử dụng option này, sẽ hiển thị thêm ngày vào mỗi dòng lệnh.
- -ttttt : khi sử dụng option này, thời gian hiển thị trên mỗi dòng chính là thời gian chênh lệch giữa thời gian tcpdump bắt được gói tin của gói tin hiện tại và gói tin đầu tiên.
- -K : với option này tcpdump sẽ bỏ qua việc checksum các gói tin.
- -N : khi sử dụng option này tcpdump sẽ không in các quality domain name ra màn hình.
- -B size : sử dụng option này để cài đặt buffer_size .
- -L : hiển thị danh sách các datalink type mà interface hỗ trợ.
- -y : lựa chọn datalinktype khi bắt các gói tin.
- dst A : khi sử dụng option này, tcpdump sẽ chỉ capture các gói tin có địa chỉ đích là “A”, có thể sử dụng kèm với từ khóa net để chỉ định một dãy mạng cụ thể. Ví dụ: tcpdump dst net 192.168.1.0/24.
- src A : tương tự như option dst, nhưng thay vì capture các gói tin có địa chỉ đích cụ thể thì nó sẽ capture các gói tin có địa chỉ nguồn như quy định.
- host A : khi sử dụng option này, tcpdump sẽ chỉ capture các gói tin có địa chỉ nguồn hoặc địa chỉ đích là “A”.
- port / port range : khi sử dụng option này, tcpdump sẽ chỉ capture các gói tin có địa chỉ port được chỉ định rõ, hoặc nằm trong khoảng range định trước. Có thể sử dụng kèm với option dst hoặc src.
- less : khi sử dụng từ khóa này, tcpdump sẽ lọc (filter) các gói tin có dung lượng nhỏ hơn giá trị chỉ định.
- greater : khi sử dụng từ khóa này, tcpdump sẽ lọc (filter) các gói tin có dung lượng cao hơn giá trị chỉ định.
- (ether | ip) broadcast: capture các gói tin ip broadcast hoặc ethernet broadcast.
- (ether | ip | ip6) multicast: capture các gói tin ethernet, ip , ipv6 multicast.
- Ngoài ra, tcpdump còn có thể capture các gói tin theo các protocol như : udp, tcp, icmp, ipv6 (chỉ cần gõ trực tiếp các từ khóa vào là được). Ví dụ: tcpdump icmp
- AND : sử dụng từ khóa and hoặc &&.
- OR : sử dụng từ khóa or hoặc ||.
- EXCEPT : sử dụng từ khóa not hoặc !.
- Ngoài ra để gom nhóm các điều kiện ta có thể dùng cặp từ khóa ‘’. Ví dụ: tcpdump –i eth0 ‘dst host 192.168.1.1 or 192.168.1.10 or 192.168.1.11’
- Hiển thị tất cả các interface trên máy tính mà tcpdump có thể lắng nghe được.
- Lọc các gói tin trên card mạng eth0, có địa chỉ đích là 192.168.1.0 hoặc địa chỉ nguồn là 192.168.1.0
#tcpdump –i eth0 src 192.168.1.0 or host 192.168.1.0
- Lọc các gói tin ARP chạy trên card mạng eth0, xuất phát từ dãy mạng 192.168.1.0/24
- Lọc các gói tin ICMP chạy trên mạng eth0, đi đến máy đích có địa chỉ MAC là 00-23-14-43-E8-08. Khi xuất ra màn hình không cho phân giải tên miền, cũng như không sử dụng số relative sequence. Lưu output vào file test.cap. Khi đọc file đó lên: không hiển thị số sequence number, không phân giải hostname.
#tcpdump –Snnr test.cap
- Lọc gói tin ICMP request and reply: sử dụng option icmp[icmptype]
- Lọc một số cờ TCP bằng tcpdump: sử dụng option tcp[tcpflags] && tcp-syn!=0. (Giá trị của các cờ TCP lần lượt là U (32) – A (16) – P (8) – R (4) – S (2) – F (1)).
- Lọc các gói tin TCP có cờ URG được bật:
- Lọc các gói tin TCP có cờ ACK được bật:
- Lọc các gói tin TCP có cờ PSH được bật:
- Lọc các gói tin TCP có cờ SYN/ACK được bật:
http://k3nshjnz.wordpress.com/2013/05/31/lenh-tcpdump-tren-linux/
Các giao thức định tuyến
Các giao thức định tuyến
/ k3nshjnz
Routing: nôm na là quá trình lựa chọn đường đi cho gói tin, giúp gói tin có thể di chuyển từ mạng nguồn đến mạng đích.Kĩ thuật Routing chia làm 2 loại lớn đó là dynamic route và static route.
1. Static Route: đây là kĩ thuật mà người quản trị phải tự cấu hình đường đi đến mạng đích trên router. Kĩ thuật này ít chiếm tài nguyên mạng và Router, đơn giản, tốc độ xử lý nhanh.Tuy nhiên nó lại có một điểm yếu là không hội tụ với những thay đổi trên mạng, đồng thời nếu như số lượng đường route quá lớn thì lại không thể cấu hình bằng tay.
2. Dynamic Route: các route thường xuyên trao đổi thông tin định tuyến cho nhau. Từ những thông tin này, các route sẽ sử dụng các thuật toán tìm đường đi khác nhau, để tìm ra đường đi đến đích tối ưu nhất theo tính toán của mình, từ đó tạo ra bảng định tuyến, lưu trữ thông tin về các đường đi này. Trong Dynamic Route thì lại chia làm 2 loại lớn đó là IGP (Interior Gateway Protocol) và EGP (Exterior Gateway Protocol).
a. Các giao thức định tuyến ngoài (EGP): đại diện tiêu biểu cho loại này là giao thức BGP(Border Gateway Protocol) là loại giao thức dùng để chạy giữa những Router thuộc các AS khác nhau. AS- Autonomous System: tạm dịch là hệ thống tự trị tập hợp các router thuộc cùng sự quản lý về kỹ thuật, sỡ hữu của một doanh nghiệp, chịu chung một chính sách định tuyến. Thường thì các AS là ISP. Như vậy định tuyến ngoài thường dùng cho các mạng Internet toàn cầu, trao đổi thông tin định tuyến lớn và thường mang nhiều policy.
b. Các giao thức định tuyến trong (IGP): gồm các giao thức tiêu biểu như RIP, OSPF, IGRP, EIGRP. Trong đó RIP và OSPF là các giao thức chuẩn quốc tế, còn EIGRP và IGRP là giao thức định tuyến riêng được phát triển trên các thiết bị Cisco. Với IGP nó lại chia theo các nhánh khác nhau. Các giao thức IGP được chia thành 3 loại: Distance-Vector, Link-state, Hybrid.
Distance -Vector: tiêu biểu cho hình thức này là giao thức RIP. Hoạt động dựa trên nguyên tắc neighbor, nghĩa là mỗi router sẽ gửi nguyên cả bảng định tuyến(routing table) của mình cho các router kết nối với nó. Các router sẽ so sánh các tuyến đường với các tuyến đường trong bảng định tuyến của mình. Tuyến đường nào tối ưu hơn sẽ được giữ lại.
- Ưu điểm của giao thức này là: dễ cấu hình, router không xử lý nhiều nên tốc độ sẽ nhanh hơn.
- Nhược điểm:
+ Hệ thống metric quá đơn giản(như Hop count) nên tuyến đường được chọn chưa phải là tối ưu nhất.
+ Vì các gói tin được gửi theo định kỳ nên một lượng lớn bandwith sẽ bị chiếm, dù cho mạng không có gì thay đổi đi nữa.
+ Do Router hội tụ chậm, dẫn đến việc sai lệch trong bảng định tuyến, gây ra tình trạng loop
Link –state: đại diện cho loại này là OSPF với loại
giao thức này, các router sẽ không gửi bảng routing table mà gửi bảng cơ
sở dữ liệu trạng thái đường link (LSDB-Link State Database) cho mọi
router cùng vùng (area). Việc tính toán định tuyến được thực hiện dựa
theo giải thuật Dijkstra. Một khi mạng đã hội tụ, thì các router sẽ
không gửi update định kỳ mà chỉ gởi khi nào có sự thay đổi trong hệ
thống mạng(link up or link down)- Ưu điểm: thích nghi được nhiều hệ thống, cho phép người thiết kế mạng linh hoạt, phản ứng nhanh. Và do không gửi interval-update nên đảm bảo được bandwith của mạng
- Nhược điểm: Router phải xử lý nhiều hơn, tốc độ CPU chậm hơn nên có delay. Ngoài ra cấu hình OSPF phức tạp hơn so với RIP
Hybrid( Advanced Distance Vertor): tiêu biểu là giao thức IGRP(hiện nay đã ngừng sử dụng) và EIGRP. Đây là họ giao thức đặc trưng trên các thiết bị Cisco. Là sự kết hợp giữa distance-vector và link-state.
Ngoài ra còn có thể chia thành 2 loại classless và classful
- Classful: không gửi kèm subnet-mask trong bảng định tuyến, nên không hỗ trợ VLSM và mạng gián đoạn
- Classless: gửi kèm subnet-mask trong bảng định tuyến. Hỗ trợ VLSM và mạng gián đoạn(discontiguos network)
http://k3nshjnz.wordpress.com/2013/05/06/cac-giao-thuc-dinh-tuyen/
Đăng ký:
Bài đăng (Atom)