หน้าเว็บ

แสดงบทความที่มีป้ายกำกับ network แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ network แสดงบทความทั้งหมด

วันจันทร์ที่ 15 สิงหาคม พ.ศ. 2554

Howto change IP on Solaris 10

Ifconfig command  ใช้สำหรับตั้งค่าอุปกรณ์การ์ดเครือข่าย  ( network card )

1. Enable the network card
#ifconfig hme0 plumb
ifconfig -a command should show following type of output which means device is enabled and is ready to configure ip address and netmask :
hme0: flags=842 mtu 1500
inet 0.0.0.0 netmask 0
ether 3:22:11:6d:2e:1f



2. Configuring ipaddress and netmask and making the interface status as up .
#ifconfig hme0 192.9.2.106 netmask 255.255.255.0 up
#ifconfig -a will now show the ip address , netmask and up status as follows :
hme0: flags=843 mtu 1500
inet 192.9.2.106 netmask ffffff00 broadcast 192.9.2.255
ether 3:22:11:6d:2e:1f

The file /etc/netmasks is used to define netmasks for ip addresses .

127.0.0.1, is the standard loop back route and 127.0.0.0 is the default loopback ipaddress used by the kernel when no interface is configured this will be the only entry displayed by the system on invoking ifconfig -a command..


3. Configuring Virtual interface
Virtual interface can be configured to enable hme0 reply to more then one ip addresses. This is possible by using hme0 alias which can be configured by ifconfig command only . The new alias device name now becomes hme0:1 hme:2 etc.
#ifconfig hme0:1 172.40.30.4 netmask 255.255.0.0 up
ifconfig -a will show the original hme0 and alias interface :
hme0: flags=843 mtu 1500
inet 192.9.2.106 netmask ffffff00 broadcast 192.9.2.255
ether 3:22:11:6d:2e:1f
hme0:1: flags=842 mtu 1500
inet 172.40.30.4 netmask ffff0000 broadcast 172.40.255.255



4. Ip-forwarding
IP forwarding allows you to forward all requests coming for a certain port or URL to be redirected to a specified IP address.
ip forwarding becomes enabled automatically when system detects more then one interface at the booting time . The file involved is /etc/rc2.d/S69inet .
ipforwarding is on by default but can be turned off by following command :
#ndd -set /dev/ip ip_forwarding 0


5. Router Configuration
After interfaces and ipaddess have been configured the system needs a default router which will allow the machine to talk to world outside of local network .
You can specify a particular route for a particular address as in following example
#route add -net 10.0.0.0 -netmask 255.0.0.0 172.40.30.1 1
if the the destination ipaddess is not defined in this manner system forwards all requests to the default router .
default route is defined manually by editing /etc/defaultrouter file and putting router’s ipaddress entry in it. This file is read by /etc/rc2.d/S69inet file during the booting process and entry added to the routing table .
The route can be defined online also using routeadd command but the changes will be lost on reboot .To make changes permanent make sure to put an entry in /etc/defaultrouter.
#route add default 205.100.155.2 1
#route change default 205.100.155.2 1
The 1 at the end is the number of hops to the next gateway.
If an interface is not responding to the network, check to be sure it has the correct IP address and netmask , network cables are fine .

Thanks  :  adminschoice.com

วันอาทิตย์ที่ 7 กุมภาพันธ์ พ.ศ. 2553

Static and Dynamic IP Addresses

Static and Dynamic IP Addresses

Benefits of Sonic.net DSL Static IP Addresses

  • Ability to host your own web, mail, or game server at your home or office
  • Always know what your IP address is, in case you need to access your home computers
  • Cheaper initial network equipment cost
  • Home networking flexibility
  • Greater compatibility with VPN networks
  • Easy access to multicast content

Possible Static IP LAN setup

Abstraction of LAN Setup

The illustration to the right shows a network configuration that is only possible with multiple static IP addresses. Four devices are connected to an ethernet switch or hub, each with its own static IP. This type of network would be possible with any Sonic.net broadband product with at least four static IPs. (1) is a typical web server, (2) a workstation, (3) a game console, and (4) is a wireless router, set up to offer Internet connectivity to wireless clients.

In this configuration, the DSL bridge/modem should be connected to your switch or hub, and any locally connected computers (PCs, Macs, Xbox, etc) can be directly connected to this switch. DHCP is offered, so you can either set the addresses of these systems static, or use DHCP on all systems.

DSL Hosted Servers

Easier to set up than with dynamic IP.

Workstation Flexibility

Public addressing make remote access simpler.

Game Consoles

No SOHO router conflicts, as there is no need for a SOHO router.

Sonic.net Open WiFi Hosting

Wireless mesh Internet access point at your location with flexibility and cost benefits. The Sonic.net Open WiFi program is available on Static and Dynamic IP connections.


Possible Dynamic IP LAN setup

Abstraction of LAN Setup

The illustration to the right shows a network configuration that is possible with either static or dynamic IP addresses. Three devices are connected to a SOHO router, each obtaining a local IP address via NAT. (1) is a typical web server, (2) a workstation, and (3) a game console. Unlike the previous example, the devices on this network are not directly-addressable from the rest of the Internet.

In this configuration, the DSL bridge/modem should be connected to your router, and any locally connected computers (PCs, Macs, Xbox, etc) can be directly connected to this router. DHCP is offered at Sonic.net, so you can let the router automatically discover its own public address.

DSL Hosted Servers

Hosting your own web, mail, DNS, or application servers on a dynamic-IP product presents a number of configuration problems. First, as your public IP address changes from time to time, it is more difficult for hosts outside your local network to find your server or servers. Dynamic DNS services (not available directly through Sonic.net at this time) can address this, but may also entail their own reliability issues. Hosting multiple computers on a single IP address — dynamic or otherwise — requires the use of a router to act as a go-between on the network. Many routers can be configured to direct certain types of traffic to specific local computers, but this process can be complicated and may require retaining the services of a networking specialist..

Workstation Flexibility

There are many reasonably user-friendly SOHO routers on the commercial market, making it easier than ever to connect multiple computers to a single-IP broadband connection. With many brands you simply need to plug the various computers into the router, and then the router into your DSL modem in order to share your connection. Remote management of workstations can be tricky due to a lack of a persistent, public address, necessitating more complicated configuration changes to your SOHO router.

Game Consoles

Sharing a Dynamic-IP connection between multiple game consoles, or between a game console and other devices such as a PC, requires a router. Many console games work without special configuration through typical SOHO routers, but others may experience networking difficulties that have to be addressed through advanced configuration changes made to the console and to the router.


Summary

Dynamic vs. Static

UseDynamic IPStatic IPsRecommended
Hosted Servers
Requires outside-hosted dynamic DNS, & DSL firewall may limit mail server activity.No special configuration required, All ports available.Static IPs
VPN Compatibility
For multiple computers requires a router. May require special configuration.For multiple computers requires a switch or hub. No special configuration should be necessary.Static IPs
Single Computer
No additional hardware or special configuration required.No additional hardware or special configuration required.Dynamic IP
Multiple Computers
Requires a router. No special configuration typically required.Requires a switch or hub. No special configuration typically required.Static IPs
Remote Management
Dynamic IP address makes this difficult, may require special configuration to router.No special configuration required.Static IPs
Game Consoles
Requires router if shared with other devices. Some special configuration may be necessary.Requires a switch or hub if shared with other devices. No special configuration should be necessary.Static IPs
Monthly Price
Lower than identical speeds with Static IPs.Lower than any other Static IP offering in our coverage area, but higher than identical speeds with Dynamic IP.Dynamic IP


Thanks : sonic.net

วันจันทร์ที่ 11 มกราคม พ.ศ. 2553

Introduction to IPSec

Introduction to IPSec

Internet Protocol security (IPSec) คือ ชุดโปรโตคอลเพิ่มเติมของโปรโตคอล IP เพื่อให้การติดต่อสื่อสารมีความปลอดภัยมากขึ้น โดยสิ่งที่เพิ่มเติมที่ทำให้มีความปลอดภัยนั่นคือ มีการทำ authentication และการ encryption ในข้อมูล IP packet ที่รับส่งกัน

ชุดโปรโตคอล IPSec นี้รวมถึงโปรโตคอลที่ใช้ในการทำ authentication ระหว่างกันเพื่อสร้าง session ที่ใช้ในการติดต่อสื่อสารและ โปรโตคอลที่ใช้เจรจา key ที่ใช้เข้ารหัสข้อมูลระหว่างการติอต่อสื่อสารของ session เราสามารถใช้ IPSec ป้องกันข้อมูลในการติดต่อสื่อสารได้ทั้งระหว่าง host กับ host (computer user or server) ระหว่าง security gateway กับ security gateway (router or firewall) หรือระหว่าง security gateway และ host โดย IPSec สามารถนำไปประยุกต์ใช้งานได้หลากหลายมาก เนื่องจากมันทำงานใน layer ที่ต่ำ (internet layer ใน TCP/IP model) ทำให้ Application ต่างๆ ไม่ต้องทำสิ่งใดเพิ่มเติมเพื่อให้ทำงานร่วมกับ IPSec ได้ ไม่เหมือนกับโปรโตคอลด้านความปลอดภัยตัวอื่น เช่น TLS/SSL ที่จะต้องออกแบบ Application ให้ทำงานร่วมกันกับมันได้

IPSec ประกอบด้วยโปรโตคอล ที่ทำหน้าที่หลักต่างๆกันดังนี้

· Internet Key Exchange (IKE) เป็นโปรโตคอลที่ใช้สำหรับการจัดตั้ง Security Association (SA) ที่ใช้เป็นช่องทางการสื่อสารระหว่างกัน และเป็นโปรโตคอลที่ใช้เจรจาว่าจะใช้โปรโตคอลใดและ algorithm ใด ทีจะใช้สร้าง key สำหรับ encrypt ข้อมูลและทำ authentication ระหว่างกัน

· Authentication Header (AH) เป็นโปรโตคอลที่ทำหน้าที่รักษาความถูกต้องสมบูรณ์ (integrity) ของข้อมูล เพื่อเป็นการยืนยันว่าข้อมูลที่ได้รับนั้นไม่ได้ถูกแก้ไขระหว่างทาง โดยการใช้ Hash Message Authentication Code (HMAC) ที่สร้างจาก algorithm เช่น MD5 หรือ SHA เป็นต้น

· Encapsulation Security Payload (ESP) เป็นโปรโตคอลที่ทำหน้าที่ในการรักษาความลับ(Confidentiality) ข้อมูลโดยการเข้ารหัส โดยใช้ algorithm เช่น DES, 3DES หรือ AES เป็นต้น

IPSec ทำงานอยู่ใน 2 mode ดังนี้

1. Transport mode ใน mode นี้ IPSec จะทำการ encrypt หรือ authenticate เฉพาะในส่วนข้อมูล (payload) ของ IP packet ที่จะส่ง แต่ไม่ทำในส่วนของ Header(หรือ IP Header) ของ IP packet

2. Tunnel mode ใน mode นี้จะทำการ encrypt หรือ authenticate ทั้ง IP packet (payload และ header) และสร้าง IP Header ขึ้นมาใหม่

ตัวอย่าง การตั้งค่า Router Cisco เพื่อใช้งาน IPSec

การตั้งค่า Router เพื่อใช้งาน IPSec มีขั้นตอนหลักๆ ดังนี้

· ตั้งค่า ISAKMP

· ตั้งค่า IPSec

ตั้งค่า ISAKMP

ทำความเข้าใจกันก่อนว่า IKE (ISAKMP/Oakley) คือ โปรโตคอลลูกผสมที่นำบางส่วนของโปรโตคอล Oakley และ ISAKMP แต่ใน Cisco IOS software โปรโตคอล IKE และ ISAKMP จะใช้สื่อความหมายถึงสิ่งเดียวกัน ดังนั้นการตั้งค่า ISAKMP ก็คือการตั้งค่า IKE โดยโปรโตคอล IKE นี้จะทำงานในช่วงการจัดตั้ง SA สำหรับ IPSec และมันต้องมี policy ที่ใช้ในการเจรจาเพื่อสร้าง SA ระหว่าง router กันด้วย

การตั้งค่า ISAKMP มีด้วยกันอยู 2 วิธีดังนี้

1. ใช้วิธี pre-shared keys ซึ่งตั้งค่าได้ง่ายและสะดวก (ตัวอย่างจะใช้วิธีนี้)

2. ใช้วิธี CA เหมาะกับรองรับการขยายตัวในการใช้งาน

หมายเหตุ โปรโตคอล IKE ทำงานบน UDP 500, IPSec ทำงานบน IP protocol 50 และ 51 โดย port เหล่านี้จะต้องไม่ถูกปิดกั้นระหว่าง router ด้วยกัน

วิธี Pre-Shared Keys

การใช้วิธีนี้จะต้องตั้งค่าตามขั้นตอนดังนี้

· ตั้งค่า ISAKMP Protection Suite(s)

· ตั้งค่า ISAKMP key

ตั้งค่า ISAKMP Protection Suite(s)

คำสั่งนี้เป็นการสร้าง object ของ ISAKMP policy

RouterName(config)#crypto isakmp policy 1

RouterName(config-isakmp)#

คำสั่ง group ใช้เพื่อบอกขนาดจำนวน bit ของ modulus ที่ใช้ในวิธีการคำนวณใน Diffie-Hellman(เป็นวิธีการการจัดตั้ง(establishment )การ shared key ผ่านบนช่องทางที่ไม่ปลอดภัย) โดย group 1 หมายถึงมีขนาด 768 บิต group 2 หมายถึง มีขนาด 1024 บิต โดย default Cisco IOS จะเป็น group 1

RouterName(config-isakmp)#group 2

คำสั่ง hash ใช้เพื่อบอกว่าจะใช้ hash algorithm แบบใด โดย default ของ Cisco IOS จะเป็นแบบ SHA ที่มีความปลอดภัยมากกว่า MD5

RouterName(config-isakmp)#hash md5

คำสั่ง lifetime ใช้เพื่อบอกว่า SA จะมีเวลาอยู่เท่าใด ก่อนที่จะมีการเจรจาสร้าง SA ใหม่ โดย default จะมีค่าอยู่ที่ 86400 วินาทีหรือ 1 วัน

RouterName(config-isakmp)#lifetime 500

คำสั่ง authentication ใช้เพื่อบอกว่าจะใช้ key อะไรในการยืนยันตัวตนของ router ทั้งฝั่ง

RouterName(config-isakmp)#authentication pre-share

ตั้งค่า ISAKMP key

คำสั่งที่จะแสดงต่อไปนี้ จะเป็นการบอกว่าค่า key เป็นอะไร และ ip ของ router ฝั่งตรงข้ามเป็นอะไร โดย key ที่ตั้งนี้จะต้องเหมือนกัน

RouterName(config-isakmp)#exit

RouterName(config-isakmp)#crypto isakmp key Slurpee address 192.168.10.38

ตั้งค่า IPSec

มีขั้นตอนย่อยๆดังนี้

· สร้าง extended access list

· สร้าง IPSec transform(s)

· สร้าง crypto map

· นำ crypto map ไปใส่ใน interface เพื่อใช้งาน

สร้าง extended access list

คำสั่งที่ใช้นี้เป็นการสร้าง access list สำหรับบอกว่า traffic ใดบ้างที่จะถูก encryption หรือไม่ถูก encryption โดยคำสั่ง permit เป็นเหมือนการบอกว่า traffic นั้นจะถูก encryption และคำสั่ง deny เป็นเหมือนการบอกว่า traffic นั้นไม่ถูก encryption โดยมีการนำไปใช้อ้างอิงใน crypto map

RouterName(config)#access-list 101 permit ip host 192.168.10.38 host 192.168.10.66

หรือ RouterName(config)#access-list 101 permit ip host 192.168.10.38 0.0.0.255 192.168.10.66 0.0.0.255

สร้าง IPSec transform(s)

คำสั่งนี้เป็นการสร้าง IPSec transform set เพื่อบอกว่าจะใช้วิธีการใดในการ encrypt ข้อมูล โดยมีการนำไปใช้อ้างอิงใน crypto map

RouterName(config)crypto ipsec transform-set MamaBear ah-md5-hmac esp-des

RouterName(cfg-crypto-trans)exit

สร้าง Crypto Map

ใน Crypto map จะมีการตั้งค่าต่างๆ ประกอบด้วย การตั้งค่าเพื่อบอกว่า peer ที่จะคุยด้วยเป็น IP อะไรโดยใช้คำสั่ง set peer การตั้งค่า session key ว่าจะมีอายุใช้งานเท่าใดก่อนมีการสร้างขึ้นใหม่ โดยมีการกำหนดได้สองแบบคือกำหนดด้วยเวลาและกำหนดด้วยขนาดข้อมูล traffic ที่รับส่งกัน การตั้งค่าผูกโยงกับ IPSec transform set ที่ได้มีการสร้างขึ้นมาก่อนหน้านี้ด้วยคำสั่ง set transform และการตั้งค่าอ้างอิงกับ access list ที่ได้สร้างขึ้นมาไว้ ด้วยคำสั่ง match address

RouterName(config)crypto map armadillo 10 ipsec-isakmp

RouterName(config-crypto-map)#set peer 192.168.10.38

RouterName(config-crypto-map)#set session-key lifetime seconds 4000

RouterName(config-crypto-map)#set transform-set MamaBear

RouterName(config-crypto-map)#match address 101

นำ crypto map ไปใส่ใน interface เพื่อใช้งาน

โดยใช้คำสั่งนี้

RouterName(config)#interface serial 0/0

RouterName(config-if)crypto map armadillo

ตัวอย่างคำสั่งที่ใช้ตรวจสอบ IPsec เช่น

Show crypto isakmp sa ใช้ดูตาราง ISAKMP(IKE) SA ถึงการมีอยู่ระหว่าง SA ของ router ทั้งสอง

Show crypto isakmp policy ใช้ดู policy ของ ISAKMP ที่ได้ตั้งค่าต่างไว้

Show crypto ipsec sa ใช้ดูค่าของ traffic ที่ถูก encrypt ฯลฯ


Thanks : kunggiggs