# vim /etc/sysconfig/network NETWORKING=yes HOSTNAME=bj.com
2. 修改網卡IP1) 確認網卡MAC地址
# ifconfig2) 根據mac地址確認網卡名稱
# vim /etc/udev/rules.d/70-persistent-net.rules3) 建立網卡的配置文件
# vim /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 BOOTPROTO=static ONBOOT=yes HWADDR=00:0C:29:BA:34:79 IPADDR=10.1.1.1 NETMASK=255.255.255.0 GATEWAY=10.1.1.2544) 重啟網絡服務
# /etc/init.d/network restart3. 修改網卡DNS服務器地址
# vim /etc/resolv.conf nameserver 8.8.8.84、網卡配置多個IP
# vim /etc/sysconfig/network-scripts/ifcfg-eth1:1 注意:device= 需要修改測試網絡
測試網絡連通性
# ping 10.1.1.1 -c 2測試DNS正常工作
nslookup路由跟蹤
traceroute 10.1.1.1-------------------------------------------------------------------------------------------------------
1、關閉SELINUX
# vim /etc/sysconfig/selinux SELINUX=disabled //重啟生效 # getenforce Disabled2、關閉防火牆--iptables
# /etc/init.d/iptables stop # chkconfig --level 2345 iptables off
軟件:dhcp*****.rpm
端口:UDP 67[DHCP服務器端] 68[DHCP客戶端]
配置文件:/etc/dhcp/dhcpd.conf
服務名稱:dhcpd
subnet 10.254.239.0 netmask 255.255.255.0 { range 10.254.239.10 10.254.239.20; option routers 10.254.239.254; option domain-name-servers 8.8.8.8; }
2、為所有地址池指定DNS服務器地址
option domain-name-servers 8.8.8.8,4.4.4.4;3、指定默認租約、最大租約時間
default-lease-time 600; max-lease-time 7200;4、為客戶機分配固定IP
host lyl { hardware ethernet 08:00:07:26:c0:a5; fixed-address 10.1.1.88; }
1、掛載光盤,安裝dhcp軟件
# mount /dev/cdrom /mnt/ # rpm -ivh /mnt/Packages/dhcp-4.1.1-31.P1.el6.i686.rpm2、修改dhcp的配置文件/etc/dhcp/dhcpd.conf
# vim /etc/dhcp/dhcpd.conf option domain-name-servers 8.8.8.8;
subnet 10.1.1.0 netmask 255.255.255.0 { range 10.1.1.100 10.1.1.200; option routers 10.1.1.254; }
3、啟動dhcpd服務,並驗證
# /etc/init.d/dhcpd start正在啟動 dhcpd: [確定]
# netstat -anup | grep :67 udp 0 0 0.0.0.0:67 0.0.0.0:* 23920/dhcpd4、將dhcpd服務調整開機自動啟動
# chkconfig --level 2345 dhcpd on # chkconfig --list dhcpd dhcpd 0:關閉 1:關閉 2:啟用 3:啟用 4:啟用 5:啟用 6:關閉5、為windows xp固定分配ip地址為10.1.1.137
1)修改dhcpd.conf配置文件
host xp { hardware ethernet 00:0c:29:34:b3:3d; fixed-address 10.1.1.137; }2)刷新dhcp的配置
# /etc/init.d/dhcpd force-reload
1、調整網絡參數
2、修改dhcpd.conf配置文件,創建出客戶機的地址池
# vim /etc/dhcp/dhcpd.conf subnet 172.16.1.0 netmask 255.255.255.0 { range 172.16.1.100 172.16.1.200; option routers 172.16.1.254; }
subnet 10.1.1.0 netmask 255.255.255.0 { }
# /etc/init.d/dhcpd restart正在啟動 dhcpd: [確定]