RH133读书笔记(8)-Lab 8 Manage Network Settings
Lab 8 Manage Network Settings
Goal: To build skills needed to manually configure networking
Estimated Duration: 45 minutes
System Setup: A Red Hat Enterprise Linux System using DHCP networking
Lab Setup: Disable the DHCP service on server1.
Sequence 1: Setting up a static IP address
Scenario: The DHCP server is down! You need to get your workstation up on the network, so you have to edit the appropriate configuration files by hand to set up static networking.
Deliverable: A system configured to operate with static rather than dynamic network settings.
Instructions:
1. Current Settings
What is your current IP address and subnet mask
[root@stationX ~]# ip addr show
What is your current default gateway
[root@stationX ~]# ip route show
What is your current DNS Name Server
[root@stationX ~]# cat /etc/resolv.conf
2. Shut Down Interface
[root@stationX ~]# ifdown eth0
Shut down your interface
3. Define Layer 3 Static Settings
Edit the configuration file of the eth0 device, so that it uses the IP Address, Network Mask, and Default Gateway settings recorded above.
Open /etc/sysconfig/network-scripts/ifcfg-eth0 in a text editor and add or edit the following lines (where X is replaced with your station number). Leave other existing lines alone (like HWADDR):
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.0.X
NETMASK=255.255.255.0
GATEWAY=192.168.0.254
4. Verify DNS and Hostname Resolution
Verify that your system is still using the recorded name server from above.
[root@stationX ~]# cat /etc/resolv.conf
search example.com
nameserver 192.168.0.254
Make sure that your hostname is set to stationX.example.com and that this hostname is used automatically at boot.
[root@stationX ~]# hostname
stationX.example.com
Open /etc/sysconfig/network in a text editor and ensure that the HOSTNAME variable is properly set:
HOSTNAME=stationX.example.com
Verify that your hostname can be resolved to the correct IP address without using DNS.
Open /etc/hosts in a text editor and ensure that the following lines appear:
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.0.X stationX.example.com stationX
5. Test new settings
Bring up your newly-configured interface and verify that your settings work.
[root@stationX ~]# ifup eth0
[root@stationX ~]# ping server1
Make sure that this configuration also works after a reboot.
[root@stationX ~]# shutdown -r now
[root@stationX ~]# ping server1
Sequence 2: Virtual IP Addresses and Static Routes
Scenario: A network service will be installed on your system. You have decided to use a virtual IP address for this service to be more flexible in the future.
Your coworker has likewise created a virtual IP address that is not routed by your gateway but which you need to gain access.
Deliverable: An additional virtual IP address available after reboot.
A static route to support access to virtual IP address of your neighbor.
System Setup: Work together with a partner. Your virtual IP address will be 10.0.X.1/24(where X is your station number). The virtual IP address of your neighbor will be 10.0.Y.1/24 (where Y is the station number of your neighbor).
Instructions:
1. Create IP alias
Configure your system with a new device alias named eth0:1 so that it uses the additional IP address 10.0.X.1 with a network mask of 255.255.255.0. This IP should also be available after reboot.
• Create /etc/sysconfig/network-scripts/ifcfg-eth0:1 in a text editor and enter the following lines (where X is your station number):
DEVICE=eth0:1
BOOTPROTO=none
ONBOOT=yes
IPADDR=10.0.X.1
NETMASK=255.255.255.0
• To verify, either reboot the system or simply activate the new device.
[root@stationX ~]# shutdown -r now
or
[root@stationX ~]# ifup eth0:1
• Test that the new interface responds locally.
[root@stationX ~]# ping 10.0.X.1
2. Create Static Route to Neighbor Alias
Create a static route to the alias network of your neighbor via the regular IP address of your neighbor:
network 10.0.Y.0/255.255.255.0 through gateway 192.168.0.Y
Make this route permanent so that it persists across reboots.
• Start by adding the following route manually:
network 10.0.Y.0/255.255.255.0 through gateway 192.168.0.Y
Note: If you have not used the ip command before, this is an excellent time to begin using it. Check ip(8) if you do not know the syntax.
[root@stationX ~]# ip route add 10.0.Y.0/24 via 192.168.0.Y
• Verify this new route.
View the current routing table to confirm the above line was added:
[root@stationX ~]# ip route
10.0.Y.0/24 via 192.168.0.Y dev eth0
See if you can access the remote network by trying to access the device alias of your neighbor:
[root@stationX ~]# ping -c 4 10.0.Y.1
• Make this route permanent and then restart networking to verify your changes persist.
Create a file named /etc/sysconfig/network-scripts/route-eth0 with the following content:
10.0.Y.0/24 via 192.168.0.Y
Restart networking
[root@stationX ~]# service network restart
Test that remote alias is still available
[root@stationX ~]# ping -c 4 10.0.Y.1
Sequence 3: Troubleshooting Slow DNS
Scenario: Our users are complaining about slow network response from this system with no additional details.
Instructions:
1. Break DNS
Modify the list of nameservers to contain a total of three: 192.168.0.X, 192.168.1.X, 192.168.0.254, in that specific order, where X is your station number.
Open /etc/resolv.conf in a text editor and ensure that the following lines appear (in the same sequence, replacing X with your station number):
search example.com
nameserver 192.168.0.X
nameserver 192.168.1.X
nameserver 192.168.0.254
2. Symptoms
Try pinging 192.168.0.254. It should be successful and the first ping should be almost immediate.
[root@stationX ~]# ping -c 4 192.168.0.254
Try pinging the same machine, but using its name, server1.example.com. The operation should be successful, but should have paused for a couple of seconds before transmitting and reporting the first ping response.
[root@stationX ~]# ping -c 4 server1
This should lead us to a determination that something is wrong with name resolution.
3. Troubleshoot and Fix
Test DNS connectivity with dig. What DNS Server is responding with an answer
[root@stationX ~]# dig server1.example.com
Compare the reported DNS server to the list of nameservers configured on this system. In what position is the reported name server
[root@stationX ~]# cat /etc/resolv.conf
The client resolver uses the list of nameservers in a fixed sequence every time. Hence the delay in resolving since the first two entries are not “responding”.
Fix the list of nameservers by returning it back to its original state.
Open /etc/resolv.conf in a text editor and ensure that the following lines appear:
search example.com
nameserver 192.168.0.254
RH133读书笔记(8)-Lab 8 Manage Network Settings的更多相关文章
- RH133读书笔记(2)-Lab 2 Working with packages
Lab 2 Working with packages Goal: To gain working experience with package management System Setup: A ...
- RH133读书 笔记(5) - Lab 5 User and Group Administration
Lab 5 User and Group Administration Goal: To build skills for user and group administration. Estimat ...
- RH133读书 笔记(3) - Lab 3 Configuring the kernel
Lab 3 Configuring the kernel Goal: Develop skills tuning the /proc filesystem. Gain some experience ...
- RH133读书笔记(9)-Lab 9 Installation and System-Initialization
Lab 9 Installation and System-Initialization Goal: Successfully install Red Hat Enterprise Linux. Sy ...
- RH133读书笔记(11)-Lab 11 System Rescue and Troubleshooting
Lab 11 System Rescue and Troubleshooting Goal: To build skills in system rescue procedures. Estimate ...
- RH133读书笔记(1)-Lab 1 Managing Startup
Lab 1 Managing Startup Goal: To familiarize yourself with the startup process System Setup: A system ...
- RH133读书 笔记(4) - Lab 4 System Services
Lab 4 System Services Goal: Develop skills using system administration tools and setting up and admi ...
- RH133读书笔记(6) - Lab 6 Adding New Filesystems to the Filesystem Tree
Lab 6 Adding New Filesystems to the Filesystem Tree Goal: Develop skills and knowlege related to par ...
- RH133读书笔记(7)-Lab 7 Advanced Filesystem Mangement
Lab 7 Advanced Filesystem Mangement Goal: Develop skills and knowlege related to Software RAID, LVM, ...
随机推荐
- 使用GraceNote Web API发展Mac发现音乐信息的应用
好久没有写博客,最近各种忙,特别忙里忙,今晚难得清闲.写最近完成下一个博客任务的摘要:使用GraceNote的Web API开发一个查询的音乐信息的应用,事实上,并在这些功能的前GraceNote S ...
- Knockout应用开发指南 第六章:加载或保存JSON数据
原文:Knockout应用开发指南 第六章:加载或保存JSON数据 加载或保存JSON数据 Knockout可以实现很复杂的客户端交互,但是几乎所有的web应用程序都要和服务器端交换数据(至少为了本地 ...
- ZOJ--3631--Watashi's BG【枚举】
链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4777 题意:有n天,告诉你每天的花费,别人给你一笔资金m,你自己也有一部 ...
- Codeforces 32E Hide-and-Seek 乞讨2关于镜面反射点 计算几何
主题链接:点击打开链接 必须指出的是,反射镜和2个人共线是不是障碍,但根据该壁其他情况 #include<cstdio> #include<iostream> #include ...
- 安装sunvirtualbox
按照网友提供的方法安装sunvirtualbox,老提示:依赖关系不满足: libpython2.6 (>= 2.6) 后来用终端运行 sudo apt-get install virtualb ...
- UseCase事件描述叙事流规范
文化/fasiondog 整理的用例需求编写规范.分享部分UseCase事件描述叙事流规范.其中.标准5~10.12来自哪里<编写有效用例>([美国] Alistair Cockburn ...
- BC 2015在百度之星程序设计大赛 - 预赛(1)(系列转换-二分法答案贪婪)
系列转换 Accepts: 816 Submissions: 3578 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 ...
- _00013 一致性哈希算法 Consistent Hashing 新的讨论,并出现相应的解决
笔者博文:妳那伊抹微笑 博客地址:http://blog.csdn.net/u012185296 个性签名:世界上最遥远的距离不是天涯,也不是海角,而是我站在妳的面前.妳却感觉不到我的存在 技术方向: ...
- Enum变量值的Discretion
有些时候,某个方法的返回值是个枚举类型,比如描述登录结果: public enum LoginResult { Success, WrongPassword, } 当前段UI获取到登陆方法的返回结果时 ...
- javascript实现倒计时-------Day28
先来两张图片,看一看今天写什么: 看到图片右上角是什么了么看到图片以下是什么了么 相信这个大家都不会陌生吧.那些生活中等着秒杀,等着抢小米人们,焦躁等待的你曾一秒一秒的盯着它看么,我不知道答案,可我知 ...