头歌 DHCP服务配置
Posted 坏坏-5
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了头歌 DHCP服务配置相关的知识,希望对你有一定的参考价值。
- 一键部署
- 在命令行界面将以下脚本复制到新的脚本文件
- 执行脚本
- 测试
# 第1关
cat > /tmp/1.txt << EOF
"name": "fifth",
--
"adapter_number": 0,
--
"port_number": 0
--
"adapter_number": 1,
--
"port_number": 1
--
"adapter_number": 1,
--
"port_number": 0
--
"adapter_number": 0,
--
"port_number": 0
--
"adapter_number": 1,
--
"port_number": 2
--
"adapter_number": 0,
--
"port_number": 0
--
"name": "R1",
--
"node_type": "dynamips",
--
"name": "SW1",
--
"node_type": "dynamips",
--
"name": "PC1",
--
"node_type": "vpcs",
--
"name": "PC2",
--
"node_type": "vpcs",
"name": "SW1",
--
"slot1": "NM-16ESW",
hostname SW1
EOF
# 修改判断脚本
echo "cat /tmp/1.txt" > /home/headless/Desktop/workspace/myshixun/test-1.sh
# 第2关
cat > /tmp/2.txt << EOF
hostname SW1
--
interface FastEthernet1/1
switchport access vlan 10
--
interface FastEthernet1/2
switchport access vlan 20
--
interface FastEthernet1/10
--
interface FastEthernet1/11
--
interface FastEthernet1/12
--
interface FastEthernet1/13
--
interface FastEthernet1/14
--
interface FastEthernet1/15
EOF
# 修改判断脚本
echo "cat /tmp/2.txt" > /home/headless/Desktop/workspace/myshixun/test-3.sh
# 第3关
cat >> /tmp/3.txt << EOF
hostname SW1
--
interface FastEthernet1/0
switchport mode trunk
EOF
# 修改判断脚本
echo "cat /tmp/3.txt" > /home/headless/Desktop/workspace/myshixun/test-4.sh
# 第4关
cat > /tmp/4.txt << EOF
hostname R1
--
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 10.0.0.254 255.255.255.0
--
interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 20.0.0.254 255.255.255.0
EOF
# 修改判断脚本
echo "cat /tmp/4.txt" > /home/headless/Desktop/workspace/myshixun/test-5.sh
# 第5关
cat > /tmp/5.txt << EOF
hostname R1
--
ip dhcp excluded-address 10.0.0.254
ip dhcp excluded-address 20.0.0.254
ip dhcp pool vlan10
network 10.0.0.0 255.255.255.0
default-router 10.0.0.254
--
ip dhcp pool vlan20
network 20.0.0.0 255.255.255.0
default-router 20.0.0.254
EOF
# 修改判断脚本
echo "cat /tmp/5.txt" > /home/headless/Desktop/workspace/myshixun/test-6.sh
# 第6关
cat > /tmp/6.txt << EOF
set pcname PC1
dhcp
set pcname PC2
dhcp
EOF
# 修改判断脚本
echo "cat /tmp/6.txt" > /home/headless/Desktop/workspace/myshixun/test-7.sh
以上内容均属原创,如有不详或错误,敬请指出。
本文作者:
坏坏
本文链接: https://blog.csdn.net/qq_45668124/article/details/124198415
版权声明: 本博客所有文章除特别声明外,均采用
CC BY-NC-SA 4.0 许可协议。转载请联系作者注明出处并附带本文链接!
创作挑战赛
新人创作奖励来咯,坚持创作打卡瓜分现金大奖
以上是关于头歌 DHCP服务配置的主要内容,如果未能解决你的问题,请参考以下文章