Академический Документы
Профессиональный Документы
Культура Документы
/etc/hosts
/etc/resolve.config
/etc/defalutrouter
/etc/nsswitchconfig
DISABLE AN INTERFACE
# ifconfig <interface> down unplumb
Setting up Solaris networking often becomes challenging for the new sysadmins and new owners of Sun systems . This document details the
steps involved in setting up of Solaris networking and can be used as a check list if you are already familiar with Solaris network configuration .
Table of contents :
3.1. Enable the network card
3.2. Configuring ipaddress and netmask and making the interface status as up .
3.3. Configuring Virtual interface :
3.4. Ip-forwarding
3.5. Router Configuration
3.6. Network Terms
3.7. Next Steps
ifconfig command is used in Solaris to configure the network interfaces. The following lines describes the activities needed to configure a freshly
installed network card from the root prompt .
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
3.2. Configuring ipaddress and netmask and making the interface status as up .
#ifconfig -a will now show the ip address , netmask and up status as follows :
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.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 :
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.
VLSM
network can be variably subnetted into smaller networks, each smaller network having a different subnet mask .This functionality is avaiable in
Solaris 2.6 above. the ipaddresses
4. Trên Ubuntu
Nếu bạn muốn cấu hình địa chỉ DHCP, bạn cần chỉnh sửa tập tin /etc/network/interfaces và nhập vào các dòng để thay thể card mạng của bạn.
- Dùng lệnh:
#sudo vi /etc/network/interfaces
Nếu bạn muốn cấu hình địa IP tĩnh, bạn cần chỉnh sửa tập tin /etc/network/interfaces và nhập vào các dòng để thay thể card mạng của bạn.
- Dùng lệnh
#sudo vi /etc/network/interfaces
Sau khi nhập các tham số bạn phải restart card mạng của bạn bằng lệnh sau (dãy IP tôi dùng trong hệ thống của tôi, còn bạn thì chắc khác ):
4.3. Thiết lập địa chỉ thứ 2 (Địa chỉ IP ảo trong Ubuntu)
Nếu bạn là người quản trị hệ thống hoặc người dùng, đôi lúc bạn rất cần có thêm địa chỉ IP thứ 2 cho máy Ubuntu của bạn. Để làm điều này, bạn cần
chỉnh sửa tập tin /etc/network/interfaces và bạn cần theo các cú pháp sau. Bên dưới là ví dụ mà bạn cần thay đổi theo địa chỉ IP mà bạn cần thiết lập
- Dùng lệnh
#sudo vi /etc/network/interfaces
auto eth0:1
iface eth0:1 inet static
address 192.168.1.60
netmask 255.255.255.0
network x.x.x.x
broadcast x.x.x.x
gateway x.x.x.x
Bạn cần nhập vào tất cả chi tiết: address, netmask, network, broadcast and gateways. Sau khi hoàn tất và lưu lại tập tin này, đừng quên restart lại card
mạng để nhận được các thông tin NEW IP ADDRESS của bạn.
Thiết lập hostname trên Ubuntu, bạn có thể truy vấn, thiết lập trực tiếp trên Ubuntu bằng lệnh hostname (các Unix khác thường dùng lệnh này để thiết
lập hostname).
#sudo /bin/hostname
Ví dụ:
Bạn có thể tham khảo thêm các thông tin khác để rõ thêm, xin vui lòng đọc thêm từ địa chỉ TẠI ĐÂY
When it comes to DNS setup Ubuntu doesn’t differ from other distributions. You can add hostname and IP addresses to the file /etc/hosts for static
lookups.
Khi thiết lập DNS, Ubuntu cũng như các HĐH khác, bạn có thêm hostname & IP Address cho tập tin /etc/hosts
Nguyên nhân máy Ubuntu của bạn tra cứu server liên quan cho việc tìm kiếm tên, đơn giản bạn chỉ cần thêm địa chỉ DNS Server (giả sử bạn đã biết)
vào tập tin /etc/resolv.conf
Ví dụ máy chủ DNS của bạn có địa chỉ IP là 172.16.1.2, bạn thêm vào tập tin resolv.conf theo lệnh sau:
#sudo vi /etc/resolv.conf
Nhập vào
search vnuhcm.edu.vn
nameserver 172.16.1.2
Giả sử rằng tên miền của bạn là vnuhcm.edu.vn