├── Configuring_配置实验 ├── Conf1_二层交换机实验 │ ├── README.md │ └── 二层交换机实验.pdf ├── Conf2_VLAN实验 │ ├── README.md │ └── VLAN实验.pdf ├── Conf3_静态路由实验 │ ├── README.md │ └── 静态路由实验.pdf ├── Conf4_VLAN间路由实验 │ ├── README.md │ ├── VLAN间路由实验.pdf │ ├── step1.txt │ ├── step2.txt │ └── step3.txt ├── Conf5_RIP配置实验 │ ├── README.md │ ├── RIP配置实验.pdf │ ├── s1.txt │ ├── s2.txt │ ├── s3.txt │ ├── s4.txt │ ├── s5.txt │ └── s6.txt ├── Conf6_OSPF配置实验 │ ├── OSPF配置实验.pdf │ ├── README.md │ └── s1.txt ├── Conf7_综合组网实验 │ ├── R1.txt │ ├── R2.txt │ ├── README.md │ ├── S1.txt │ ├── S2.txt │ └── 综合组网实验.pdf └── 配置实验查错方法.pdf ├── Programming_编程实验 ├── Prog1_数据表示实验 │ ├── README.md │ ├── src │ │ ├── FilePack.c │ │ └── StructSave.c │ └── 数据表示实验.pdf ├── Prog2_Echo实验 │ ├── Echo实验.pdf │ ├── README.md │ └── src │ │ ├── TCP │ │ ├── TcpEcho_Client.c │ │ ├── TcpEcho_Server.c │ │ └── TcpEcho_Server_Enhanced.cpp │ │ └── UDP │ │ ├── UdpEcho_Client.c │ │ └── UdpEcho_Server.cpp ├── Prog3_Chat实验 │ ├── Chat实验.pdf │ ├── GroupChat_Client │ │ ├── client.cpp │ │ └── client.h │ ├── GroupChat_Server │ │ ├── server.cpp │ │ └── server.h │ └── README.md ├── Prog4_应用层实验 │ ├── FtpDownloader │ │ ├── FtpDownloader.cpp │ │ └── FtpDownloader.h │ ├── README.md │ ├── TcpClient │ │ ├── TcpClient.cpp │ │ └── TcpClient.h │ └── 应用层实验.pdf └── Prog5_文件传输实验 │ ├── 17341203_张怡昕_文件传输实验.doc │ ├── src │ ├── FileTransfer_Client.cpp │ └── FileTransfer_Server.cpp │ └── 文件传输实验.pdf ├── README.md └── 计网理论练习题 ├── 作业1.html ├── 作业2.html ├── 作业3.html ├── 作业4.html ├── 作业5.html └── 作业6.html /Configuring_配置实验/Conf1_二层交换机实验/README.md: -------------------------------------------------------------------------------- 1 | # 二层交换机实验 2 | 3 | 2019.4.28 4 | 5 | 6 | 7 | ## 说明 8 | 9 | 本实验为配置实验,无需编程。报告文档见[二层交换机实验.pdf](二层交换机实验.pdf),仅供参考。 10 | 11 | -------------------------------------------------------------------------------- /Configuring_配置实验/Conf1_二层交换机实验/二层交换机实验.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Configuring_配置实验/Conf1_二层交换机实验/二层交换机实验.pdf -------------------------------------------------------------------------------- /Configuring_配置实验/Conf2_VLAN实验/README.md: -------------------------------------------------------------------------------- 1 | # VLAN 实验 2 | 3 | 2019.5.7 4 | 5 | 6 | 7 | ## 说明 8 | 9 | 本实验为配置实验,无需编程。报告文档见[VLAN实验.pdf](VLAN实验.pdf),仅供参考。 10 | 11 | -------------------------------------------------------------------------------- /Configuring_配置实验/Conf2_VLAN实验/VLAN实验.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Configuring_配置实验/Conf2_VLAN实验/VLAN实验.pdf -------------------------------------------------------------------------------- /Configuring_配置实验/Conf3_静态路由实验/README.md: -------------------------------------------------------------------------------- 1 | # 静态路由实验 2 | 3 | 2019.5.19 4 | 5 | 6 | 7 | ## 说明 8 | 9 | 本实验为配置实验,无需编程。报告文档见[静态路由实验.pdf](静态路由实验.pdf),仅供参考。 10 | 11 | -------------------------------------------------------------------------------- /Configuring_配置实验/Conf3_静态路由实验/静态路由实验.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Configuring_配置实验/Conf3_静态路由实验/静态路由实验.pdf -------------------------------------------------------------------------------- /Configuring_配置实验/Conf4_VLAN间路由实验/README.md: -------------------------------------------------------------------------------- 1 | # VLAN间路由实验 2 | 3 | 2019.5.26 4 | 5 | 6 | 7 | ## 说明 8 | 9 | 本实验为配置实验,无需编程。报告文档见[VLAN间路由实验.pdf](VLAN间路由实验.pdf),仅供参考。 10 | 11 | -------------------------------------------------------------------------------- /Configuring_配置实验/Conf4_VLAN间路由实验/VLAN间路由实验.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Configuring_配置实验/Conf4_VLAN间路由实验/VLAN间路由实验.pdf -------------------------------------------------------------------------------- /Configuring_配置实验/Conf4_VLAN间路由实验/step1.txt: -------------------------------------------------------------------------------- 1 | [A] 2 | show vlan 3 | VLAN Name Status Ports 4 | ---- -------------------------------- --------- ----------------------------------- 5 | 1 VLAN0001 STATIC Gi0/1, Gi0/2, Gi0/3, Gi0/4 6 | Gi0/5, Gi0/6, Gi0/7, Gi0/8 7 | Gi0/9, Gi0/11, Gi0/12, Gi0/13 8 | Gi0/14, Gi0/15, Gi0/16, Gi0/17 9 | Gi0/18, Gi0/19, Gi0/21, Gi0/22 10 | Gi0/25, Gi0/26, Gi0/27, Gi0/28 11 | 10 VLAN0010 STATIC Gi0/6, Gi0/10, Gi0/23 12 | 20 VLAN0020 STATIC Gi0/6, Gi0/20, Gi0/24 13 | 20-S5750-1(config)# 14 | 20-S5750-1(config)#show vlan 15 | VLAN Name Status Ports 16 | ---- -------------------------------- --------- ----------------------------------- 17 | 1 VLAN0001 STATIC Gi0/1, Gi0/2, Gi0/3, Gi0/4 18 | Gi0/5, Gi0/6, Gi0/7, Gi0/8 19 | Gi0/9, Gi0/11, Gi0/12, Gi0/13 20 | Gi0/14, Gi0/15, Gi0/16, Gi0/17 21 | Gi0/18, Gi0/19, Gi0/21, Gi0/22 22 | Gi0/25, Gi0/26, Gi0/27, Gi0/28 23 | 10 VLAN0010 STATIC Gi0/6, Gi0/10, Gi0/23 24 | 20 VLAN0020 STATIC Gi0/6, Gi0/20, Gi0/24 25 | 26 | 27 | 28 | 29 | [B] 30 | 20-S5750-1(config)#show running-config 31 | 32 | Building configuration... 33 | Current configuration : 1430 bytes 34 | 35 | ! 36 | version RGOS 10.4(2b12)p2 Release(180357)(Mon Dec 1 17:42:40 CST 2014 -ngcf64) 37 | hostname 20-S5750-1 38 | ! 39 | ! 40 | ! 41 | ! 42 | ! 43 | ! 44 | ! 45 | nfpp 46 | ! 47 | ! 48 | vlan 1 49 | ! 50 | vlan 10 51 | ! 52 | vlan 20 53 | ! 54 | ! 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | [C] 65 | 20-S5750-2#show vlan 66 | VLAN Name Status Ports 67 | ---- -------------------------------- --------- ----------------------------------- 68 | 1 VLAN0001 STATIC Gi0/1, Gi0/2, Gi0/3, Gi0/4 69 | Gi0/5, Gi0/6, Gi0/7, Gi0/8 70 | Gi0/9, Gi0/11, Gi0/12, Gi0/13 71 | Gi0/14, Gi0/15, Gi0/16, Gi0/17 72 | Gi0/18, Gi0/19, Gi0/21, Gi0/22 73 | Gi0/23, Gi0/24, Gi0/25, Gi0/26 74 | Gi0/27, Gi0/28 75 | 10 VLAN0010 STATIC Gi0/6, Gi0/10 76 | 20 VLAN0020 STATIC Gi0/6, Gi0/20 77 | 78 | [D] 79 | 20-S5750-2#show running-config 80 | 81 | Building configuration... 82 | Current configuration : 1374 bytes 83 | 84 | ! 85 | version RGOS 10.4(2b12)p2 Release(180357)(Mon Dec 1 17:42:40 CST 2014 -ngcf64) 86 | hostname 20-S5750-2 87 | ! 88 | ! 89 | ! 90 | ! 91 | ! 92 | ! 93 | ! 94 | nfpp 95 | ! 96 | ! 97 | vlan 1 98 | ! 99 | vlan 10 100 | ! 101 | vlan 20 102 | ! 103 | ! 104 | no service password-encryption 105 | 106 | 107 | 108 | 109 | 110 | [E] 111 | 112 | 20-RSR20-1(config)#show ip route 113 | 114 | Codes: C - connected, S - static, R - RIP, B - BGP 115 | O - OSPF, IA - OSPF inter area 116 | N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 117 | E1 - OSPF external type 1, E2 - OSPF external type 2 118 | i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 119 | ia - IS-IS inter area, * - candidate default 120 | 121 | Gateway of last resort is no set 122 | C 192.168.10.0/24 is directly connected, GigabitEthernet 0/0 123 | C 192.168.10.254/32 is local host. 124 | C 192.168.20.0/24 is directly connected, GigabitEthernet 0/1 125 | C 192.168.20.254/32 is local host. 126 | 127 | 128 | 129 | 130 | [F] 131 | 20-RSR20-1(config)#show ip interface brief 132 | Interface IP-Address(Pri) IP-Address(Sec) Status Protocol 133 | Serial 2/0 no address no address up down 134 | SIC-3G-WCDMA 3/0 no address no address up down 135 | GigabitEthernet 0/0 192.168.10.254/24 no address up up 136 | GigabitEthernet 0/1 192.168.20.254/24 no address up up 137 | VLAN 1 no address no address up down 138 | 139 | 140 | 141 | 142 | 143 | [G] 144 | 20-RSR20-1(config)#show running-config 145 | 146 | Building configuration... 147 | Current configuration : 1870 bytes 148 | 149 | ! 150 | version RGOS 10.4(3b23) Release(176514)(Mon Jul 28 18:19:31 CST 2014 -ngcf62) 151 | hostname 20-RSR20-1 152 | webmaster level 0 username admin password 7 0121474e3e16 153 | ! 154 | ! 155 | ! 156 | ! 157 | ! 158 | ! 159 | diffserv domain default 160 | ! 161 | ! 162 | ! 163 | ! 164 | cwmp 165 | ! 166 | ! 167 | ! 168 | ! 169 | ! 170 | ! 171 | vlan 1 172 | ! 173 | ! 174 | no service password-encryption 175 | ! 176 | ! 177 | ! 178 | ! 179 | ! 180 | ! 181 | ! 182 | ! 183 | ! 184 | ! 185 | ! 186 | ! 187 | ! 188 | ! 189 | ! 190 | ! 191 | ! 192 | ! 193 | ! 194 | control-plane 195 | ! 196 | control-plane protocol 197 | no acpp 198 | ! 199 | control-plane manage 200 | no port-filter 201 | no arp-car 202 | no acpp 203 | ! 204 | control-plane data 205 | no glean-car 206 | no acpp 207 | ! 208 | ! 209 | ! 210 | ! 211 | enable service web-server http 212 | enable service web-server https 213 | ! 214 | ! 215 | ! 216 | ! 217 | ! 218 | ! 219 | ! 220 | ! 221 | ! 222 | ! 223 | ! 224 | ! 225 | ! 226 | ! 227 | ! 228 | interface Serial 2/0 229 | encapsulation HDLC 230 | clock rate 64000 231 | ! 232 | interface FastEthernet 1/0 233 | ! 234 | interface FastEthernet 1/1 235 | ! 236 | interface FastEthernet 1/2 237 | ! 238 | interface FastEthernet 1/3 239 | ! 240 | interface FastEthernet 1/4 241 | ! 242 | interface FastEthernet 1/5 243 | ! 244 | interface FastEthernet 1/6 245 | ! 246 | interface FastEthernet 1/7 247 | ! 248 | interface FastEthernet 1/8 249 | ! 250 | interface FastEthernet 1/9 251 | ! 252 | interface FastEthernet 1/10 253 | ! 254 | interface FastEthernet 1/11 255 | ! 256 | interface FastEthernet 1/12 257 | ! 258 | interface FastEthernet 1/13 259 | ! 260 | interface FastEthernet 1/14 261 | ! 262 | interface FastEthernet 1/15 263 | ! 264 | interface FastEthernet 1/16 265 | ! 266 | interface FastEthernet 1/17 267 | ! 268 | interface FastEthernet 1/18 269 | ! 270 | interface FastEthernet 1/19 271 | ! 272 | interface FastEthernet 1/20 273 | ! 274 | interface FastEthernet 1/21 275 | ! 276 | interface FastEthernet 1/22 277 | ! 278 | interface FastEthernet 1/23 279 | ! 280 | interface GigabitEthernet 0/0 281 | ip address 192.168.10.254 255.255.255.0 282 | duplex auto 283 | speed auto 284 | ! 285 | interface GigabitEthernet 0/1 286 | ip address 192.168.20.254 255.255.255.0 287 | duplex auto 288 | speed auto 289 | ! 290 | interface VLAN 1 291 | ! 292 | ! 293 | ! 294 | ! 295 | ! 296 | ! 297 | ! 298 | ! 299 | ! 300 | ! 301 | ! 302 | ! 303 | ! 304 | ! 305 | ! 306 | ! 307 | ! 308 | ! 309 | ! 310 | ! 311 | ! 312 | ! 313 | ! 314 | ! 315 | ref parameter 75 140 316 | line con 0 317 | line aux 0 318 | line tty 1 319 | modem InOut 320 | line vty 0 4 321 | login 322 | password b402 323 | ! 324 | ! 325 | end -------------------------------------------------------------------------------- /Configuring_配置实验/Conf4_VLAN间路由实验/step2.txt: -------------------------------------------------------------------------------- 1 | [A] 2 | 20-S5750-1(config-if-GigabitEthernet 0/23)#show vlan 3 | VLAN Name Status Ports 4 | ---- -------------------------------- --------- ----------------------------------- 5 | 1 VLAN0001 STATIC Gi0/1, Gi0/2, Gi0/3, Gi0/4 6 | Gi0/5, Gi0/6, Gi0/7, Gi0/8 7 | Gi0/9, Gi0/11, Gi0/12, Gi0/13 8 | Gi0/14, Gi0/15, Gi0/16, Gi0/17 9 | Gi0/18, Gi0/19, Gi0/21, Gi0/22 10 | Gi0/23, Gi0/24, Gi0/25, Gi0/26 11 | Gi0/27, Gi0/28 12 | 10 VLAN0010 STATIC Gi0/6, Gi0/10, Gi0/24 13 | 20 VLAN0020 STATIC Gi0/6, Gi0/20, Gi0/24 14 | 15 | 16 | 17 | 18 | 19 | 20 | [B] 21 | 20-S5750-1(config-if-GigabitEthernet 0/23)#show running-config 22 | 23 | Building configuration... 24 | Current configuration : 1398 bytes 25 | 26 | ! 27 | version RGOS 10.4(2b12)p2 Release(180357)(Mon Dec 1 17:42:40 CST 2014 -ngcf64) 28 | hostname 20-S5750-1 29 | ! 30 | ! 31 | ! 32 | ! 33 | ! 34 | ! 35 | ! 36 | nfpp 37 | ! 38 | ! 39 | vlan 1 40 | ! 41 | vlan 10 42 | ! 43 | vlan 20 44 | ! 45 | ! 46 | no service password-encryption 47 | ! 48 | ! 49 | ! 50 | ! 51 | ! 52 | ! 53 | ! 54 | ! 55 | interface GigabitEthernet 0/1 56 | ! 57 | interface GigabitEthernet 0/2 58 | ! 59 | interface GigabitEthernet 0/3 60 | ! 61 | interface GigabitEthernet 0/4 62 | ! 63 | interface GigabitEthernet 0/5 64 | ! 65 | interface GigabitEthernet 0/6 66 | switchport mode trunk 67 | ! 68 | interface GigabitEthernet 0/7 69 | ! 70 | interface GigabitEthernet 0/8 71 | ! 72 | interface GigabitEthernet 0/9 73 | ! 74 | interface GigabitEthernet 0/10 75 | switchport access vlan 10 76 | ! 77 | interface GigabitEthernet 0/11 78 | ! 79 | interface GigabitEthernet 0/12 80 | ! 81 | interface GigabitEthernet 0/13 82 | ! 83 | interface GigabitEthernet 0/14 84 | ! 85 | interface GigabitEthernet 0/15 86 | ! 87 | interface GigabitEthernet 0/16 88 | ! 89 | interface GigabitEthernet 0/17 90 | ! 91 | interface GigabitEthernet 0/18 92 | ! 93 | interface GigabitEthernet 0/19 94 | ! 95 | interface GigabitEthernet 0/20 96 | switchport access vlan 20 97 | ! 98 | interface GigabitEthernet 0/21 99 | ! 100 | interface GigabitEthernet 0/22 101 | ! 102 | interface GigabitEthernet 0/23 103 | ! 104 | interface GigabitEthernet 0/24 105 | switchport mode trunk 106 | ! 107 | interface GigabitEthernet 0/25 108 | ! 109 | interface GigabitEthernet 0/26 110 | ! 111 | interface GigabitEthernet 0/27 112 | ! 113 | interface GigabitEthernet 0/28 114 | ! 115 | ! 116 | ! 117 | ! 118 | ! 119 | ! 120 | ! 121 | ! 122 | ! 123 | ! 124 | ! 125 | line con 0 126 | line vty 0 4 127 | login 128 | password b402 129 | ! 130 | ! 131 | end 132 | 133 | 134 | 135 | 136 | [C] 137 | 20-RSR20-1(config)#show ip route 138 | 139 | Codes: C - connected, S - static, R - RIP, B - BGP 140 | O - OSPF, IA - OSPF inter area 141 | N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 142 | E1 - OSPF external type 1, E2 - OSPF external type 2 143 | i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 144 | ia - IS-IS inter area, * - candidate default 145 | 146 | Gateway of last resort is no set 147 | C 192.168.10.0/24 is directly connected, GigabitEthernet 0/0.10 148 | C 192.168.10.254/32 is local host. 149 | C 192.168.20.0/24 is directly connected, GigabitEthernet 0/0.20 150 | C 192.168.20.254/32 is local host. 151 | 152 | 153 | 154 | [D] 155 | 20-RSR20-1(config)#show ip interface brief 156 | Interface IP-Address(Pri) IP-Address(Sec) Status Protocol 157 | Serial 2/0 no address no address up down 158 | SIC-3G-WCDMA 3/0 no address no address up down 159 | GigabitEthernet 0/0.20 192.168.20.254/24 no address up up 160 | GigabitEthernet 0/0.10 192.168.10.254/24 no address up up 161 | GigabitEthernet 0/0 no address no address up down 162 | GigabitEthernet 0/1 no address no address down down 163 | VLAN 1 no address no address up down 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | [E] 181 | 20-RSR20-1(config)#show running-config 182 | 183 | Building configuration... 184 | Current configuration : 1994 bytes 185 | 186 | ! 187 | version RGOS 10.4(3b23) Release(176514)(Mon Jul 28 18:19:31 CST 2014 -ngcf62) 188 | hostname 20-RSR20-1 189 | webmaster level 0 username admin password 7 0121474e3e16 190 | ! 191 | ! 192 | ! 193 | ! 194 | ! 195 | ! 196 | diffserv domain default 197 | ! 198 | ! 199 | ! 200 | ! 201 | cwmp 202 | ! 203 | ! 204 | ! 205 | ! 206 | ! 207 | ! 208 | vlan 1 209 | ! 210 | ! 211 | no service password-encryption 212 | ! 213 | ! 214 | ! 215 | ! 216 | ! 217 | ! 218 | ! 219 | ! 220 | ! 221 | ! 222 | ! 223 | ! 224 | ! 225 | ! 226 | ! 227 | ! 228 | ! 229 | ! 230 | ! 231 | control-plane 232 | ! 233 | control-plane protocol 234 | no acpp 235 | ! 236 | control-plane manage 237 | no port-filter 238 | no arp-car 239 | no acpp 240 | ! 241 | control-plane data 242 | no glean-car 243 | no acpp 244 | ! 245 | ! 246 | ! 247 | ! 248 | enable service web-server http 249 | enable service web-server https 250 | ! 251 | ! 252 | ! 253 | ! 254 | ! 255 | ! 256 | ! 257 | ! 258 | ! 259 | ! 260 | ! 261 | ! 262 | ! 263 | ! 264 | ! 265 | interface Serial 2/0 266 | encapsulation HDLC 267 | clock rate 64000 268 | ! 269 | interface FastEthernet 1/0 270 | ! 271 | interface FastEthernet 1/1 272 | ! 273 | interface FastEthernet 1/2 274 | ! 275 | interface FastEthernet 1/3 276 | ! 277 | interface FastEthernet 1/4 278 | ! 279 | interface FastEthernet 1/5 280 | ! 281 | interface FastEthernet 1/6 282 | ! 283 | interface FastEthernet 1/7 284 | ! 285 | interface FastEthernet 1/8 286 | ! 287 | interface FastEthernet 1/9 288 | ! 289 | interface FastEthernet 1/10 290 | ! 291 | interface FastEthernet 1/11 292 | ! 293 | interface FastEthernet 1/12 294 | ! 295 | interface FastEthernet 1/13 296 | ! 297 | interface FastEthernet 1/14 298 | ! 299 | interface FastEthernet 1/15 300 | ! 301 | interface FastEthernet 1/16 302 | ! 303 | interface FastEthernet 1/17 304 | ! 305 | interface FastEthernet 1/18 306 | ! 307 | interface FastEthernet 1/19 308 | ! 309 | interface FastEthernet 1/20 310 | ! 311 | interface FastEthernet 1/21 312 | ! 313 | interface FastEthernet 1/22 314 | ! 315 | interface FastEthernet 1/23 316 | ! 317 | interface GigabitEthernet 0/0 318 | duplex auto 319 | speed auto 320 | ! 321 | interface GigabitEthernet 0/0.10 322 | encapsulation dot1Q 10 323 | ip address 192.168.10.254 255.255.255.0 324 | ! 325 | interface GigabitEthernet 0/0.20 326 | encapsulation dot1Q 20 327 | ip address 192.168.20.254 255.255.255.0 328 | ! 329 | interface GigabitEthernet 0/1 330 | duplex auto 331 | speed auto 332 | ! 333 | interface VLAN 1 334 | ! 335 | ! 336 | ! 337 | ! 338 | ! 339 | ! 340 | ! 341 | ! 342 | ! 343 | ! 344 | ! 345 | ! 346 | ! 347 | ! 348 | ! 349 | ! 350 | ! 351 | ! 352 | ! 353 | ! 354 | ! 355 | ! 356 | ! 357 | ! 358 | ref parameter 75 140 359 | line con 0 360 | line aux 0 361 | line tty 1 362 | modem InOut 363 | line vty 0 4 364 | login 365 | password b402 366 | ! 367 | ! 368 | end -------------------------------------------------------------------------------- /Configuring_配置实验/Conf4_VLAN间路由实验/step3.txt: -------------------------------------------------------------------------------- 1 | [A] 2 | 20-S5750-1(config-if-GigabitEthernet 0/24)#show vlan 3 | VLAN Name Status Ports 4 | ---- -------------------------------- --------- ----------------------------------- 5 | 1 VLAN0001 STATIC Gi0/1, Gi0/2, Gi0/3, Gi0/4 6 | Gi0/5, Gi0/6, Gi0/7, Gi0/8 7 | Gi0/9, Gi0/11, Gi0/12, Gi0/13 8 | Gi0/14, Gi0/15, Gi0/16, Gi0/17 9 | Gi0/18, Gi0/19, Gi0/21, Gi0/22 10 | Gi0/23, Gi0/24, Gi0/25, Gi0/26 11 | Gi0/27, Gi0/28 12 | 10 VLAN0010 STATIC Gi0/6, Gi0/10, Gi0/24 13 | 20 VLAN0020 STATIC Gi0/6, Gi0/20, Gi0/24 14 | 20-S5750-1(config-if-GigabitEthernet 0/24)#switchport mode access 15 | 20-S5750-1(config-if-GigabitEthernet 0/24)#show vlan 16 | VLAN Name Status Ports 17 | ---- -------------------------------- --------- ----------------------------------- 18 | 1 VLAN0001 STATIC Gi0/1, Gi0/2, Gi0/3, Gi0/4 19 | Gi0/5, Gi0/6, Gi0/7, Gi0/8 20 | Gi0/9, Gi0/11, Gi0/12, Gi0/13 21 | Gi0/14, Gi0/15, Gi0/16, Gi0/17 22 | Gi0/18, Gi0/19, Gi0/21, Gi0/22 23 | Gi0/23, Gi0/24, Gi0/25, Gi0/26 24 | Gi0/27, Gi0/28 25 | 10 VLAN0010 STATIC Gi0/6, Gi0/10 26 | 20 VLAN0020 STATIC Gi0/6, Gi0/20 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | [B] 35 | 20-S5750-1(config-if-GigabitEthernet 0/24)#show running-config 36 | 37 | Building configuration... 38 | Current configuration : 1538 bytes 39 | 40 | ! 41 | version RGOS 10.4(2b12)p2 Release(180357)(Mon Dec 1 17:42:40 CST 2014 -ngcf64) 42 | hostname 20-S5750-1 43 | ! 44 | ! 45 | ! 46 | ! 47 | ! 48 | ! 49 | ! 50 | nfpp 51 | ! 52 | ! 53 | vlan 1 54 | ! 55 | vlan 10 56 | ! 57 | vlan 20 58 | ! 59 | ! 60 | no service password-encryption 61 | ! 62 | ! 63 | ! 64 | ! 65 | ! 66 | ! 67 | ! 68 | ! 69 | interface GigabitEthernet 0/1 70 | ! 71 | interface GigabitEthernet 0/2 72 | ! 73 | interface GigabitEthernet 0/3 74 | ! 75 | interface GigabitEthernet 0/4 76 | ! 77 | interface GigabitEthernet 0/5 78 | ! 79 | interface GigabitEthernet 0/6 80 | switchport mode trunk 81 | ! 82 | interface GigabitEthernet 0/7 83 | ! 84 | interface GigabitEthernet 0/8 85 | ! 86 | interface GigabitEthernet 0/9 87 | ! 88 | interface GigabitEthernet 0/10 89 | switchport access vlan 10 90 | ! 91 | interface GigabitEthernet 0/11 92 | ! 93 | interface GigabitEthernet 0/12 94 | ! 95 | interface GigabitEthernet 0/13 96 | ! 97 | interface GigabitEthernet 0/14 98 | ! 99 | interface GigabitEthernet 0/15 100 | ! 101 | interface GigabitEthernet 0/16 102 | ! 103 | interface GigabitEthernet 0/17 104 | ! 105 | interface GigabitEthernet 0/18 106 | ! 107 | interface GigabitEthernet 0/19 108 | ! 109 | interface GigabitEthernet 0/20 110 | switchport access vlan 20 111 | ! 112 | interface GigabitEthernet 0/21 113 | ! 114 | interface GigabitEthernet 0/22 115 | ! 116 | interface GigabitEthernet 0/23 117 | ! 118 | interface GigabitEthernet 0/24 119 | ! 120 | interface GigabitEthernet 0/25 121 | ! 122 | interface GigabitEthernet 0/26 123 | ! 124 | interface GigabitEthernet 0/27 125 | ! 126 | interface GigabitEthernet 0/28 127 | ! 128 | interface VLAN 10 129 | no ip proxy-arp 130 | ip address 192.168.10.254 255.255.255.0 131 | ! 132 | interface VLAN 20 133 | no ip proxy-arp 134 | ip address 192.168.20.254 255.255.255.0 135 | ! 136 | ! 137 | ! 138 | ! 139 | ! 140 | ! 141 | ! 142 | ! 143 | ! 144 | ! 145 | ! 146 | line con 0 147 | line vty 0 4 148 | login 149 | password b402 150 | ! 151 | ! 152 | end \ 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | [C] 162 | 20-S5750-1(config-if-GigabitEthernet 0/24)#show i route 163 | ^ 164 | % Invalid input detected at '^' marker. 165 | 166 | 20-S5750-1(config-if-GigabitEthernet 0/24)#show ip route 167 | 168 | Codes: C - connected, S - static, R - RIP, B - BGP 169 | O - OSPF, IA - OSPF inter area 170 | N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 171 | E1 - OSPF external type 1, E2 - OSPF external type 2 172 | i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 173 | ia - IS-IS inter area, * - candidate default 174 | 175 | Gateway of last resort is no set 176 | C 192.168.10.0/24 is directly connected, VLAN 10 177 | C 192.168.10.254/32 is local host. 178 | C 192.168.20.0/24 is directly connected, VLAN 20 179 | C 192.168.20.254/32 is local host. 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | [D] 192 | 20-S5750-1(config-if-GigabitEthernet 0/24)#show ip interface brief 193 | Interface IP-Address(Pri) OK? Status 194 | VLAN 10 192.168.10.254/24 YES UP 195 | VLAN 20 192.168.20.254/24 YES UP -------------------------------------------------------------------------------- /Configuring_配置实验/Conf5_RIP配置实验/README.md: -------------------------------------------------------------------------------- 1 | # RIP配置实验 2 | 3 | 2019.6.9 4 | 5 | 6 | 7 | ## 说明 8 | 9 | 本实验为配置实验,无需编程。报告文档见[RIP配置实验.pdf](RIP配置实验.pdf),仅供参考。*注意,本次实验(RIP配置实验)中可能包含较多错误,请谨慎参考。* 10 | 11 | -------------------------------------------------------------------------------- /Configuring_配置实验/Conf5_RIP配置实验/RIP配置实验.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Configuring_配置实验/Conf5_RIP配置实验/RIP配置实验.pdf -------------------------------------------------------------------------------- /Configuring_配置实验/Conf5_RIP配置实验/s1.txt: -------------------------------------------------------------------------------- 1 | 【router 1】 2 | 3 | 4 | 19-RSR20-1(config-router)#show running-config 5 | 6 | Building configuration... 7 | Current configuration : 903 bytes 8 | 9 | ! 10 | version RGOS 10.3(5b6), Release(132193)(Thu Mar 22 18:30:26 CST 2012 -ngcf67) 11 | hostname 19-RSR20-1 12 | ! 13 | ! 14 | ! 15 | ! 16 | ! 17 | ! 18 | no service password-encryption 19 | ! 20 | ! 21 | ! 22 | ! 23 | ! 24 | ! 25 | ! 26 | ! 27 | ! 28 | ! 29 | ! 30 | ! 31 | ! 32 | ! 33 | ! 34 | ! 35 | control-plane 36 | ! 37 | control-plane protocol 38 | no acpp 39 | ! 40 | control-plane manage 41 | no port-filter 42 | no arp-car 43 | no acpp 44 | ! 45 | control-plane data 46 | no glean-car 47 | no acpp 48 | ! 49 | ! 50 | ! 51 | ! 52 | ! 53 | ! 54 | ! 55 | ! 56 | ! 57 | ! 58 | ! 59 | ! 60 | interface Serial 2/0 61 | encapsulation HDLC 62 | ! 63 | interface Serial 4/0 64 | encapsulation HDLC 65 | clock rate 64000 66 | ! 67 | interface FastEthernet 0/0 68 | ip address 192.168.1.1 255.255.255.0 69 | duplex auto 70 | speed auto 71 | ! 72 | interface FastEthernet 0/1 73 | ip address 192.168.2.1 255.255.255.0 74 | duplex auto 75 | speed auto 76 | ! 77 | ! 78 | ! 79 | ! 80 | ! 81 | ! 82 | ! 83 | router rip 84 | version 2 85 | network 192.168.1.0 86 | network 192.168.2.0 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | *************************************************************************** 109 | 【router 2】 110 | 111 | 112 | 19-RSR20-2(config-router)#show running-config 113 | 114 | Building configuration... 115 | Current configuration : 922 bytes 116 | 117 | ! 118 | version RGOS 10.3(5b6), Release(132193)(Thu Mar 22 18:30:26 CST 2012 -ngcf67) 119 | hostname 19-RSR20-2 120 | ! 121 | ! 122 | ! 123 | ! 124 | ! 125 | ! 126 | no service password-encryption 127 | ! 128 | ! 129 | ! 130 | ! 131 | ! 132 | ! 133 | ! 134 | ! 135 | ! 136 | ! 137 | ! 138 | ! 139 | ! 140 | ! 141 | ! 142 | ! 143 | control-plane 144 | ! 145 | control-plane protocol 146 | no acpp 147 | ! 148 | control-plane manage 149 | no port-filter 150 | no arp-car 151 | no acpp 152 | ! 153 | control-plane data 154 | no glean-car 155 | no acpp 156 | ! 157 | ! 158 | ! 159 | ! 160 | ! 161 | ! 162 | ! 163 | ! 164 | ! 165 | ! 166 | ! 167 | ! 168 | interface Serial 2/0 169 | encapsulation HDLC 170 | clock rate 64000 171 | ! 172 | interface Serial 4/0 173 | encapsulation HDLC 174 | clock rate 64000 175 | ! 176 | interface FastEthernet 0/0 177 | ip address 192.168.3.2 255.255.255.0 178 | duplex auto 179 | speed auto 180 | ! 181 | interface FastEthernet 0/1 182 | ip address 192.168.2.2 255.255.255.0 183 | duplex auto 184 | speed auto 185 | ! 186 | ! 187 | ! 188 | ! 189 | ! 190 | ! 191 | ! 192 | router rip 193 | version 2 194 | network 192.168.2.0 195 | network 192.168.3.0 196 | ! 197 | ! 198 | ! 199 | ! 200 | ! 201 | ref parameter 50 400 202 | line con 0 203 | line aux 0 204 | line vty 0 4 205 | login 206 | password b402 207 | ! 208 | ! 209 | end -------------------------------------------------------------------------------- /Configuring_配置实验/Conf5_RIP配置实验/s2.txt: -------------------------------------------------------------------------------- 1 | 【router 1】 2 | 3 | 19-RSR20-1(config-router)#show running-config 4 | 5 | Building configuration... 6 | Current configuration : 907 bytes 7 | 8 | ! 9 | version RGOS 10.3(5b6), Release(132193)(Thu Mar 22 18:30:26 CST 2012 -ngcf67) 10 | hostname 19-RSR20-1 11 | ! 12 | ! 13 | ! 14 | ! 15 | ! 16 | ! 17 | no service password-encryption 18 | ! 19 | ! 20 | ! 21 | ! 22 | ! 23 | ! 24 | ! 25 | ! 26 | ! 27 | ! 28 | ! 29 | ! 30 | ! 31 | ! 32 | ! 33 | ! 34 | control-plane 35 | ! 36 | control-plane protocol 37 | no acpp 38 | ! 39 | control-plane manage 40 | no port-filter 41 | no arp-car 42 | no acpp 43 | ! 44 | control-plane data 45 | no glean-car 46 | no acpp 47 | ! 48 | ! 49 | ! 50 | ! 51 | ! 52 | ! 53 | ! 54 | ! 55 | ! 56 | ! 57 | ! 58 | ! 59 | interface Serial 2/0 60 | encapsulation HDLC 61 | ! 62 | interface Serial 4/0 63 | encapsulation HDLC 64 | clock rate 64000 65 | ! 66 | interface FastEthernet 0/0 67 | ip address 192.168.1.129 255.255.255.192 68 | duplex auto 69 | speed auto 70 | ! 71 | interface FastEthernet 0/1 72 | ip address 192.168.2.1 255.255.255.0 73 | duplex auto 74 | speed auto 75 | ! 76 | ! 77 | ! 78 | ! 79 | ! 80 | ! 81 | ! 82 | router rip 83 | version 2 84 | network 192.168.1.0 85 | network 192.168.2.0 86 | ! 87 | ! 88 | ! 89 | ! 90 | ! 91 | ref parameter 50 400 92 | line con 0 93 | line aux 0 94 | line vty 0 4 95 | login 96 | password b402 97 | ! 98 | ! 99 | end 100 | 101 | 102 | *************************************************************************** 103 | 【router 2】 104 | 105 | 19-RSR20-2(config)#show running-config 106 | 107 | Building configuration... 108 | Current configuration : 986 bytes 109 | 110 | ! 111 | version RGOS 10.3(5b6), Release(132193)(Thu Mar 22 18:30:26 CST 2012 -ngcf67) 112 | hostname 19-RSR20-2 113 | ! 114 | ! 115 | ! 116 | ! 117 | ! 118 | ! 119 | no service password-encryption 120 | ! 121 | ! 122 | ! 123 | ! 124 | ! 125 | ! 126 | ! 127 | ! 128 | ! 129 | ! 130 | ! 131 | ! 132 | ! 133 | ! 134 | ! 135 | ! 136 | control-plane 137 | ! 138 | control-plane protocol 139 | no acpp 140 | ! 141 | control-plane manage 142 | no port-filter 143 | no arp-car 144 | no acpp 145 | ! 146 | control-plane data 147 | no glean-car 148 | no acpp 149 | ! 150 | ! 151 | ! 152 | ! 153 | ! 154 | ! 155 | ! 156 | ! 157 | ! 158 | ! 159 | ! 160 | ! 161 | interface Serial 2/0 162 | encapsulation HDLC 163 | clock rate 64000 164 | ! 165 | interface Serial 4/0 166 | encapsulation HDLC 167 | clock rate 64000 168 | ! 169 | interface FastEthernet 0/0 170 | ip address 192.168.3.2 255.255.255.0 171 | duplex auto 172 | speed auto 173 | ! 174 | interface FastEthernet 0/1 175 | ip address 192.168.2.2 255.255.255.0 176 | duplex auto 177 | speed auto 178 | ! 179 | interface Loopback 0 180 | ip address 192.168.4.2 255.255.255.0 181 | ! 182 | ! 183 | ! 184 | ! 185 | ! 186 | ! 187 | ! 188 | router rip 189 | version 2 190 | network 192.168.2.0 191 | network 192.168.3.0 192 | ! 193 | ! 194 | ! 195 | ! 196 | ! 197 | ref parameter 50 400 198 | line con 0 199 | line aux 0 200 | line vty 0 4 201 | login 202 | password b402 203 | ! 204 | ! 205 | end 206 | 207 | 208 | *************************************************************************** 209 | 【switch 1】 210 | 211 | 19-S5750-1#show running-config 212 | 213 | Building configuration... 214 | Current configuration : 1554 bytes 215 | 216 | ! 217 | version RGOS 10.4(2b11)p1 Release(134566)(Wed Apr 25 21:05:17 CST 2012 -ngcf67) 218 | hostname 19-S5750-1 219 | ! 220 | ! 221 | ! 222 | nfpp 223 | ! 224 | ! 225 | vlan 1 226 | ! 227 | ! 228 | no service password-encryption 229 | ip http authentication local 230 | ! 231 | ! 232 | ! 233 | ! 234 | enable service web-server 235 | ! 236 | ! 237 | ! 238 | ! 239 | interface GigabitEthernet 0/1 240 | ! 241 | interface GigabitEthernet 0/2 242 | ! 243 | interface GigabitEthernet 0/3 244 | ! 245 | interface GigabitEthernet 0/4 246 | ! 247 | interface GigabitEthernet 0/5 248 | ! 249 | interface GigabitEthernet 0/6 250 | no switchport 251 | no ip proxy-arp 252 | ip address 192.168.1.1 255.255.255.192 253 | ! 254 | interface GigabitEthernet 0/7 255 | ! 256 | interface GigabitEthernet 0/8 257 | no switchport 258 | no ip proxy-arp 259 | ip address 192.168.1.65 255.255.255.192 260 | ! 261 | interface GigabitEthernet 0/9 262 | ! 263 | interface GigabitEthernet 0/10 264 | ! 265 | interface GigabitEthernet 0/11 266 | ! 267 | interface GigabitEthernet 0/12 268 | ! 269 | interface GigabitEthernet 0/13 270 | ! 271 | interface GigabitEthernet 0/14 272 | ! 273 | interface GigabitEthernet 0/15 274 | ! 275 | interface GigabitEthernet 0/16 276 | ! 277 | interface GigabitEthernet 0/17 278 | ! 279 | interface GigabitEthernet 0/18 280 | ! 281 | interface GigabitEthernet 0/19 282 | ! 283 | interface GigabitEthernet 0/20 284 | ! 285 | interface GigabitEthernet 0/21 286 | ! 287 | interface GigabitEthernet 0/22 288 | ! 289 | interface GigabitEthernet 0/23 290 | ! 291 | interface GigabitEthernet 0/24 292 | ! 293 | interface GigabitEthernet 0/25 294 | ! 295 | interface GigabitEthernet 0/26 296 | ! 297 | interface GigabitEthernet 0/27 298 | ! 299 | interface GigabitEthernet 0/28 300 | ! 301 | interface VLAN 1 302 | no ip proxy-arp 303 | ! 304 | ! 305 | ! 306 | ! 307 | ! 308 | ! 309 | ! 310 | ! 311 | ! 312 | router rip 313 | version 2 314 | network 192.168.1.0 315 | ! 316 | ! 317 | ! 318 | line con 0 319 | line vty 0 4 320 | login 321 | password b402 322 | ! 323 | ! 324 | end 325 | 326 | 327 | *************************************************************************** 328 | 【switch 2】 329 | 330 | 19-S5750-2(config-router)#show running-config 331 | 332 | Building configuration... 333 | Current configuration : 1537 bytes 334 | 335 | ! 336 | version RGOS 10.4(2b11)p1 Release(134566)(Wed Apr 25 21:05:17 CST 2012 -ngcf67) 337 | hostname 19-S5750-2 338 | ! 339 | ! 340 | ! 341 | nfpp 342 | ! 343 | ! 344 | vlan 1 345 | ! 346 | ! 347 | no service password-encryption 348 | ! 349 | ! 350 | ! 351 | ! 352 | ! 353 | ! 354 | ! 355 | ! 356 | interface GigabitEthernet 0/1 357 | ! 358 | interface GigabitEthernet 0/2 359 | ! 360 | interface GigabitEthernet 0/3 361 | ! 362 | interface GigabitEthernet 0/4 363 | ! 364 | interface GigabitEthernet 0/5 365 | ! 366 | interface GigabitEthernet 0/6 367 | no switchport 368 | no ip proxy-arp 369 | ip address 192.168.1.194 255.255.255.192 370 | ! 371 | interface GigabitEthernet 0/7 372 | ! 373 | interface GigabitEthernet 0/8 374 | no switchport 375 | no ip proxy-arp 376 | ip address 192.168.1.66 255.255.255.192 377 | ! 378 | interface GigabitEthernet 0/9 379 | ! 380 | interface GigabitEthernet 0/10 381 | ! 382 | interface GigabitEthernet 0/11 383 | ! 384 | interface GigabitEthernet 0/12 385 | ! 386 | interface GigabitEthernet 0/13 387 | ! 388 | interface GigabitEthernet 0/14 389 | no switchport 390 | no ip proxy-arp 391 | ip address 192.168.1.130 255.255.255.192 392 | ! 393 | interface GigabitEthernet 0/15 394 | ! 395 | interface GigabitEthernet 0/16 396 | ! 397 | interface GigabitEthernet 0/17 398 | ! 399 | interface GigabitEthernet 0/18 400 | ! 401 | interface GigabitEthernet 0/19 402 | ! 403 | interface GigabitEthernet 0/20 404 | ! 405 | interface GigabitEthernet 0/21 406 | ! 407 | interface GigabitEthernet 0/22 408 | ! 409 | interface GigabitEthernet 0/23 410 | ! 411 | interface GigabitEthernet 0/24 412 | ! 413 | interface GigabitEthernet 0/25 414 | ! 415 | interface GigabitEthernet 0/26 416 | ! 417 | interface GigabitEthernet 0/27 418 | ! 419 | interface GigabitEthernet 0/28 420 | ! 421 | ! 422 | ! 423 | ! 424 | ! 425 | ! 426 | ! 427 | ! 428 | ! 429 | router rip 430 | version 2 431 | network 192.168.1.0 432 | ! 433 | ! 434 | ! 435 | line con 0 436 | line vty 0 4 437 | login 438 | password b402 439 | ! 440 | ! 441 | end 442 | -------------------------------------------------------------------------------- /Configuring_配置实验/Conf5_RIP配置实验/s3.txt: -------------------------------------------------------------------------------- 1 | 【Rounter 1】 2 | 3 | 4 | 20-RSR20-1(config)#show running-config 5 | 6 | Building configuration... 7 | Current configuration : 1937 bytes 8 | 9 | ! 10 | version RGOS 10.4(3b23) Release(176514)(Mon Jul 28 18:19:31 CST 2014 -ngcf62) 11 | hostname 20-RSR20-1 12 | webmaster level 0 username admin password 7 0121474e3e16 13 | ! 14 | ! 15 | ! 16 | ! 17 | ! 18 | ! 19 | diffserv domain default 20 | ! 21 | ! 22 | ! 23 | ! 24 | cwmp 25 | ! 26 | ! 27 | ! 28 | ! 29 | ! 30 | ! 31 | vlan 1 32 | ! 33 | ! 34 | no service password-encryption 35 | ! 36 | ! 37 | ! 38 | ! 39 | ! 40 | ! 41 | ! 42 | ! 43 | ! 44 | ! 45 | ! 46 | ! 47 | ! 48 | ! 49 | ! 50 | ! 51 | ! 52 | ! 53 | ! 54 | control-plane 55 | ! 56 | control-plane protocol 57 | no acpp 58 | ! 59 | control-plane manage 60 | no port-filter 61 | no arp-car 62 | no acpp 63 | ! 64 | control-plane data 65 | no glean-car 66 | no acpp 67 | ! 68 | ! 69 | ! 70 | ! 71 | enable service web-server http 72 | enable service web-server https 73 | ! 74 | ! 75 | ! 76 | ! 77 | ! 78 | ! 79 | ! 80 | ! 81 | ! 82 | ! 83 | ! 84 | ! 85 | ! 86 | ! 87 | ! 88 | interface Serial 2/0 89 | encapsulation HDLC 90 | clock rate 64000 91 | ! 92 | interface FastEthernet 1/0 93 | ! 94 | interface FastEthernet 1/1 95 | ! 96 | interface FastEthernet 1/2 97 | ! 98 | interface FastEthernet 1/3 99 | ! 100 | interface FastEthernet 1/4 101 | ! 102 | interface FastEthernet 1/5 103 | ! 104 | interface FastEthernet 1/6 105 | ! 106 | interface FastEthernet 1/7 107 | ! 108 | interface FastEthernet 1/8 109 | ! 110 | interface FastEthernet 1/9 111 | ! 112 | interface FastEthernet 1/10 113 | ! 114 | interface FastEthernet 1/11 115 | ! 116 | interface FastEthernet 1/12 117 | ! 118 | interface FastEthernet 1/13 119 | ! 120 | interface FastEthernet 1/14 121 | ! 122 | interface FastEthernet 1/15 123 | ! 124 | interface FastEthernet 1/16 125 | ! 126 | interface FastEthernet 1/17 127 | ! 128 | interface FastEthernet 1/18 129 | ! 130 | interface FastEthernet 1/19 131 | ! 132 | interface FastEthernet 1/20 133 | ! 134 | interface FastEthernet 1/21 135 | ! 136 | interface FastEthernet 1/22 137 | ! 138 | interface FastEthernet 1/23 139 | ! 140 | interface GigabitEthernet 0/0 141 | ip address 192.168.3.129 255.255.255.0 142 | duplex auto 143 | speed auto 144 | ! 145 | interface GigabitEthernet 0/1 146 | ip address 192.168.2.1 255.255.255.0 147 | duplex auto 148 | speed auto 149 | ! 150 | interface VLAN 1 151 | ! 152 | ! 153 | ! 154 | ! 155 | ! 156 | ! 157 | ! 158 | ! 159 | ! 160 | ! 161 | ! 162 | ! 163 | ! 164 | ! 165 | ! 166 | ! 167 | ! 168 | router rip 169 | version 2 170 | network 192.168.2.0 171 | network 192.168.3.0 172 | ! 173 | ! 174 | ! 175 | ! 176 | ! 177 | ! 178 | ! 179 | ! 180 | ref parameter 75 140 181 | line con 0 182 | line aux 0 183 | line tty 1 184 | modem InOut 185 | line vty 0 4 186 | login 187 | password b402 188 | ! 189 | ! 190 | end 191 | 192 | 193 | *************************************************************************** 194 | 【Rounter 2】 195 | 196 | 197 | 20-RSR20-2(config-router)#show running-config 198 | 199 | Building configuration... 200 | Current configuration : 2023 bytes 201 | 202 | ! 203 | version RGOS 10.4(3b23) Release(176514)(Mon Jul 28 18:19:31 CST 2014 -ngcf62) 204 | hostname 20-RSR20-2 205 | webmaster level 0 username admin password 7 1226011f4303 206 | ! 207 | ! 208 | ! 209 | ! 210 | ! 211 | ! 212 | diffserv domain default 213 | ! 214 | ! 215 | ! 216 | ! 217 | cwmp 218 | ! 219 | ! 220 | ! 221 | ! 222 | ! 223 | ! 224 | vlan 1 225 | ! 226 | ! 227 | no service password-encryption 228 | ! 229 | ! 230 | ! 231 | ! 232 | ! 233 | ! 234 | ! 235 | ! 236 | ! 237 | ! 238 | ! 239 | ! 240 | ! 241 | ! 242 | ! 243 | ! 244 | ! 245 | ! 246 | ! 247 | control-plane 248 | ! 249 | control-plane protocol 250 | no acpp 251 | ! 252 | control-plane manage 253 | no port-filter 254 | no arp-car 255 | no acpp 256 | ! 257 | control-plane data 258 | no glean-car 259 | no acpp 260 | ! 261 | ! 262 | ! 263 | ! 264 | enable service web-server http 265 | enable service web-server https 266 | ! 267 | ! 268 | ! 269 | ! 270 | ! 271 | ! 272 | ! 273 | ! 274 | ! 275 | ! 276 | ! 277 | ! 278 | ! 279 | ! 280 | ! 281 | interface Serial 2/0 282 | encapsulation HDLC 283 | ! 284 | interface Serial 3/0 285 | encapsulation HDLC 286 | clock rate 64000 287 | ! 288 | interface FastEthernet 1/0 289 | ! 290 | interface FastEthernet 1/1 291 | ! 292 | interface FastEthernet 1/2 293 | ! 294 | interface FastEthernet 1/3 295 | ! 296 | interface FastEthernet 1/4 297 | ! 298 | interface FastEthernet 1/5 299 | ! 300 | interface FastEthernet 1/6 301 | ! 302 | interface FastEthernet 1/7 303 | ! 304 | interface FastEthernet 1/8 305 | ! 306 | interface FastEthernet 1/9 307 | ! 308 | interface FastEthernet 1/10 309 | ! 310 | interface FastEthernet 1/11 311 | ! 312 | interface FastEthernet 1/12 313 | ! 314 | interface FastEthernet 1/13 315 | ! 316 | interface FastEthernet 1/14 317 | ! 318 | interface FastEthernet 1/15 319 | ! 320 | interface FastEthernet 1/16 321 | ! 322 | interface FastEthernet 1/17 323 | ! 324 | interface FastEthernet 1/18 325 | ! 326 | interface FastEthernet 1/19 327 | ! 328 | interface FastEthernet 1/20 329 | ! 330 | interface FastEthernet 1/21 331 | ! 332 | interface FastEthernet 1/22 333 | ! 334 | interface FastEthernet 1/23 335 | ! 336 | interface GigabitEthernet 0/0 337 | ip address 192.168.1.130 255.255.255.192 338 | duplex auto 339 | speed auto 340 | ! 341 | interface GigabitEthernet 0/1 342 | ip address 192.168.2.2 255.255.255.0 343 | duplex auto 344 | speed auto 345 | ! 346 | interface Loopback 0 347 | ip address 192.168.4.2 255.255.255.0 348 | ! 349 | interface VLAN 1 350 | ! 351 | ! 352 | ! 353 | ! 354 | ! 355 | ! 356 | ! 357 | ! 358 | ! 359 | ! 360 | ! 361 | ! 362 | ! 363 | ! 364 | ! 365 | ! 366 | ! 367 | router rip 368 | version 2 369 | network 192.168.1.0 370 | network 192.168.2.0 371 | ! 372 | ! 373 | ! 374 | ! 375 | ! 376 | ! 377 | ! 378 | ! 379 | ref parameter 75 140 380 | line con 0 381 | line aux 0 382 | line vty 0 4 383 | login 384 | password b402 385 | ! 386 | ! 387 | end 388 | 389 | *************************************************************************** 390 | 【Switch 1】 391 | 392 | 393 | 20-S5750-1(config)#show running-config 394 | 395 | Building configuration... 396 | Current configuration : 1470 bytes 397 | 398 | ! 399 | version RGOS 10.4(2b12)p2 Release(180357)(Mon Dec 1 17:42:40 CST 2014 -ngcf64) 400 | hostname 20-S5750-1 401 | ! 402 | ! 403 | ! 404 | ! 405 | ! 406 | ! 407 | ! 408 | nfpp 409 | ! 410 | ! 411 | vlan 1 412 | ! 413 | ! 414 | no service password-encryption 415 | ! 416 | ! 417 | ! 418 | ! 419 | ! 420 | ! 421 | ! 422 | ! 423 | interface GigabitEthernet 0/1 424 | ! 425 | interface GigabitEthernet 0/2 426 | ! 427 | interface GigabitEthernet 0/3 428 | ! 429 | interface GigabitEthernet 0/4 430 | ! 431 | interface GigabitEthernet 0/5 432 | ! 433 | interface GigabitEthernet 0/6 434 | no switchport 435 | no ip proxy-arp 436 | ip address 192.168.1.1 255.255.255.192 437 | ! 438 | interface GigabitEthernet 0/7 439 | ! 440 | interface GigabitEthernet 0/8 441 | no switchport 442 | no ip proxy-arp 443 | ip address 192.168.1.65 255.255.255.192 444 | ! 445 | interface GigabitEthernet 0/9 446 | ! 447 | interface GigabitEthernet 0/10 448 | ! 449 | interface GigabitEthernet 0/11 450 | ! 451 | interface GigabitEthernet 0/12 452 | ! 453 | interface GigabitEthernet 0/13 454 | ! 455 | interface GigabitEthernet 0/14 456 | ! 457 | interface GigabitEthernet 0/15 458 | ! 459 | interface GigabitEthernet 0/16 460 | ! 461 | interface GigabitEthernet 0/17 462 | ! 463 | interface GigabitEthernet 0/18 464 | ! 465 | interface GigabitEthernet 0/19 466 | ! 467 | interface GigabitEthernet 0/20 468 | ! 469 | interface GigabitEthernet 0/21 470 | ! 471 | interface GigabitEthernet 0/22 472 | ! 473 | interface GigabitEthernet 0/23 474 | ! 475 | interface GigabitEthernet 0/24 476 | ! 477 | interface GigabitEthernet 0/25 478 | ! 479 | interface GigabitEthernet 0/26 480 | ! 481 | interface GigabitEthernet 0/27 482 | ! 483 | interface GigabitEthernet 0/28 484 | ! 485 | ! 486 | ! 487 | ! 488 | ! 489 | ! 490 | ! 491 | ! 492 | ! 493 | router rip 494 | version 2 495 | network 192.168.1.0 496 | ! 497 | ! 498 | ! 499 | line con 0 500 | line vty 0 4 501 | login 502 | password b402 503 | ! 504 | ! 505 | end 506 | 507 | *************************************************************************** 508 | 【Switcher 2】 509 | 510 | 511 | 20-S5750-2(config)#show running-config 512 | 513 | Building configuration... 514 | Current configuration : 1569 bytes 515 | 516 | ! 517 | version RGOS 10.4(2b12)p2 Release(180357)(Mon Dec 1 17:42:40 CST 2014 -ngcf64) 518 | hostname 20-S5750-2 519 | ! 520 | ! 521 | ! 522 | ! 523 | ! 524 | ! 525 | ! 526 | nfpp 527 | ! 528 | ! 529 | vlan 1 530 | ! 531 | ! 532 | no service password-encryption 533 | ! 534 | ! 535 | ! 536 | ! 537 | ! 538 | ! 539 | ! 540 | ! 541 | interface GigabitEthernet 0/1 542 | ! 543 | interface GigabitEthernet 0/2 544 | ! 545 | interface GigabitEthernet 0/3 546 | ! 547 | interface GigabitEthernet 0/4 548 | ! 549 | interface GigabitEthernet 0/5 550 | ! 551 | interface GigabitEthernet 0/6 552 | no switchport 553 | no ip proxy-arp 554 | ip address 192.168.1.194 255.255.255.192 555 | ! 556 | interface GigabitEthernet 0/7 557 | ! 558 | interface GigabitEthernet 0/8 559 | no switchport 560 | no ip proxy-arp 561 | ip address 192.168.1.66 255.255.255.192 562 | ! 563 | interface GigabitEthernet 0/9 564 | ! 565 | interface GigabitEthernet 0/10 566 | ! 567 | interface GigabitEthernet 0/11 568 | ! 569 | interface GigabitEthernet 0/12 570 | ! 571 | interface GigabitEthernet 0/13 572 | ! 573 | interface GigabitEthernet 0/14 574 | no switchport 575 | no ip proxy-arp 576 | ip address 192.168.3.130 255.255.255.0 577 | ! 578 | interface GigabitEthernet 0/15 579 | ! 580 | interface GigabitEthernet 0/16 581 | ! 582 | interface GigabitEthernet 0/17 583 | ! 584 | interface GigabitEthernet 0/18 585 | ! 586 | interface GigabitEthernet 0/19 587 | ! 588 | interface GigabitEthernet 0/20 589 | ! 590 | interface GigabitEthernet 0/21 591 | ! 592 | interface GigabitEthernet 0/22 593 | ! 594 | interface GigabitEthernet 0/23 595 | ! 596 | interface GigabitEthernet 0/24 597 | ! 598 | interface GigabitEthernet 0/25 599 | ! 600 | interface GigabitEthernet 0/26 601 | ! 602 | interface GigabitEthernet 0/27 603 | ! 604 | interface GigabitEthernet 0/28 605 | ! 606 | ! 607 | ! 608 | ! 609 | ! 610 | ! 611 | ! 612 | ! 613 | ! 614 | router rip 615 | version 2 616 | network 192.168.1.0 617 | network 192.168.3.0 618 | ! 619 | ! 620 | ! 621 | line con 0 622 | line vty 0 4 623 | login 624 | password b402 625 | ! 626 | ! 627 | end -------------------------------------------------------------------------------- /Configuring_配置实验/Conf5_RIP配置实验/s4.txt: -------------------------------------------------------------------------------- 1 | 【Router 1】 2 | 3 | 4 | 20-RSR20-1(config)#show running-config 5 | 6 | Building configuration... 7 | Current configuration : 1937 bytes 8 | 9 | ! 10 | version RGOS 10.4(3b23) Release(176514)(Mon Jul 28 18:19:31 CST 2014 -ngcf62) 11 | hostname 20-RSR20-1 12 | webmaster level 0 username admin password 7 0121474e3e16 13 | ! 14 | ! 15 | ! 16 | ! 17 | ! 18 | ! 19 | diffserv domain default 20 | ! 21 | ! 22 | ! 23 | ! 24 | cwmp 25 | ! 26 | ! 27 | ! 28 | ! 29 | ! 30 | ! 31 | vlan 1 32 | ! 33 | ! 34 | no service password-encryption 35 | ! 36 | ! 37 | ! 38 | ! 39 | ! 40 | ! 41 | ! 42 | ! 43 | ! 44 | ! 45 | ! 46 | ! 47 | ! 48 | ! 49 | ! 50 | ! 51 | ! 52 | ! 53 | ! 54 | control-plane 55 | ! 56 | control-plane protocol 57 | no acpp 58 | ! 59 | control-plane manage 60 | no port-filter 61 | no arp-car 62 | no acpp 63 | ! 64 | control-plane data 65 | no glean-car 66 | no acpp 67 | ! 68 | ! 69 | ! 70 | ! 71 | enable service web-server http 72 | enable service web-server https 73 | ! 74 | ! 75 | ! 76 | ! 77 | ! 78 | ! 79 | ! 80 | ! 81 | ! 82 | ! 83 | ! 84 | ! 85 | ! 86 | ! 87 | ! 88 | interface Serial 2/0 89 | encapsulation HDLC 90 | clock rate 64000 91 | ! 92 | interface FastEthernet 1/0 93 | ! 94 | interface FastEthernet 1/1 95 | ! 96 | interface FastEthernet 1/2 97 | ! 98 | interface FastEthernet 1/3 99 | ! 100 | interface FastEthernet 1/4 101 | ! 102 | interface FastEthernet 1/5 103 | ! 104 | interface FastEthernet 1/6 105 | ! 106 | interface FastEthernet 1/7 107 | ! 108 | interface FastEthernet 1/8 109 | ! 110 | interface FastEthernet 1/9 111 | ! 112 | interface FastEthernet 1/10 113 | ! 114 | interface FastEthernet 1/11 115 | ! 116 | interface FastEthernet 1/12 117 | ! 118 | interface FastEthernet 1/13 119 | ! 120 | interface FastEthernet 1/14 121 | ! 122 | interface FastEthernet 1/15 123 | ! 124 | interface FastEthernet 1/16 125 | ! 126 | interface FastEthernet 1/17 127 | ! 128 | interface FastEthernet 1/18 129 | ! 130 | interface FastEthernet 1/19 131 | ! 132 | interface FastEthernet 1/20 133 | ! 134 | interface FastEthernet 1/21 135 | ! 136 | interface FastEthernet 1/22 137 | ! 138 | interface FastEthernet 1/23 139 | ! 140 | interface GigabitEthernet 0/0 141 | ip address 192.168.3.129 255.255.255.0 142 | duplex auto 143 | speed auto 144 | ! 145 | interface GigabitEthernet 0/1 146 | ip address 192.168.2.1 255.255.255.0 147 | duplex auto 148 | speed auto 149 | ! 150 | interface VLAN 1 151 | ! 152 | ! 153 | ! 154 | ! 155 | ! 156 | ! 157 | ! 158 | ! 159 | ! 160 | ! 161 | ! 162 | ! 163 | ! 164 | ! 165 | ! 166 | ! 167 | ! 168 | router rip 169 | version 2 170 | network 192.168.2.0 171 | network 192.168.3.0 172 | ! 173 | ! 174 | ! 175 | ! 176 | ! 177 | ! 178 | ! 179 | ! 180 | ref parameter 75 140 181 | line con 0 182 | line aux 0 183 | line tty 1 184 | modem InOut 185 | line vty 0 4 186 | login 187 | password b402 188 | ! 189 | ! 190 | end 191 | 192 | 193 | 194 | *************************************************************************** 195 | 【Router 2】 196 | 197 | 198 | 20-RSR20-2(config-router)#show running-config 199 | 200 | Building configuration... 201 | Current configuration : 2041 bytes 202 | 203 | ! 204 | version RGOS 10.4(3b23) Release(176514)(Mon Jul 28 18:19:31 CST 2014 -ngcf62) 205 | hostname 20-RSR20-2 206 | webmaster level 0 username admin password 7 1226011f4303 207 | ! 208 | ! 209 | ! 210 | ! 211 | ! 212 | ! 213 | diffserv domain default 214 | ! 215 | ! 216 | ! 217 | ! 218 | cwmp 219 | ! 220 | ! 221 | ! 222 | ! 223 | ! 224 | ! 225 | vlan 1 226 | ! 227 | ! 228 | no service password-encryption 229 | ! 230 | ! 231 | ! 232 | ! 233 | ! 234 | ! 235 | ! 236 | ! 237 | ! 238 | ! 239 | ! 240 | ! 241 | ! 242 | ! 243 | ! 244 | ! 245 | ! 246 | ! 247 | ! 248 | control-plane 249 | ! 250 | control-plane protocol 251 | no acpp 252 | ! 253 | control-plane manage 254 | no port-filter 255 | no arp-car 256 | no acpp 257 | ! 258 | control-plane data 259 | no glean-car 260 | no acpp 261 | ! 262 | ! 263 | ! 264 | ! 265 | enable service web-server http 266 | enable service web-server https 267 | ! 268 | ! 269 | ! 270 | ! 271 | ! 272 | ! 273 | ! 274 | ! 275 | ! 276 | ! 277 | ! 278 | ! 279 | ! 280 | ! 281 | ! 282 | interface Serial 2/0 283 | encapsulation HDLC 284 | ! 285 | interface Serial 3/0 286 | encapsulation HDLC 287 | clock rate 64000 288 | ! 289 | interface FastEthernet 1/0 290 | ! 291 | interface FastEthernet 1/1 292 | ! 293 | interface FastEthernet 1/2 294 | ! 295 | interface FastEthernet 1/3 296 | ! 297 | interface FastEthernet 1/4 298 | ! 299 | interface FastEthernet 1/5 300 | ! 301 | interface FastEthernet 1/6 302 | ! 303 | interface FastEthernet 1/7 304 | ! 305 | interface FastEthernet 1/8 306 | ! 307 | interface FastEthernet 1/9 308 | ! 309 | interface FastEthernet 1/10 310 | ! 311 | interface FastEthernet 1/11 312 | ! 313 | interface FastEthernet 1/12 314 | ! 315 | interface FastEthernet 1/13 316 | ! 317 | interface FastEthernet 1/14 318 | ! 319 | interface FastEthernet 1/15 320 | ! 321 | interface FastEthernet 1/16 322 | ! 323 | interface FastEthernet 1/17 324 | ! 325 | interface FastEthernet 1/18 326 | ! 327 | interface FastEthernet 1/19 328 | ! 329 | interface FastEthernet 1/20 330 | ! 331 | interface FastEthernet 1/21 332 | ! 333 | interface FastEthernet 1/22 334 | ! 335 | interface FastEthernet 1/23 336 | ! 337 | interface GigabitEthernet 0/0 338 | ip address 192.168.1.130 255.255.255.192 339 | duplex auto 340 | speed auto 341 | ! 342 | interface GigabitEthernet 0/1 343 | ip address 192.168.2.2 255.255.255.0 344 | duplex auto 345 | speed auto 346 | ! 347 | interface Loopback 0 348 | ip address 192.168.4.2 255.255.255.0 349 | ! 350 | interface VLAN 1 351 | ! 352 | ! 353 | ! 354 | ! 355 | ! 356 | ! 357 | ! 358 | ! 359 | ! 360 | ! 361 | ! 362 | ! 363 | ! 364 | ! 365 | ! 366 | ! 367 | ! 368 | router rip 369 | version 2 370 | network 192.168.1.0 371 | network 192.168.2.0 372 | no auto-summary 373 | ! 374 | ! 375 | ! 376 | ! 377 | ! 378 | ! 379 | ! 380 | ! 381 | ref parameter 75 140 382 | line con 0 383 | line aux 0 384 | line vty 0 4 385 | login 386 | password b402 387 | ! 388 | ! 389 | end 390 | 391 | 392 | *************************************************************************** 393 | 【Switch 1】 394 | 395 | 396 | 20-S5750-1(config)#show running-config 397 | 398 | Building configuration... 399 | Current configuration : 1470 bytes 400 | 401 | ! 402 | version RGOS 10.4(2b12)p2 Release(180357)(Mon Dec 1 17:42:40 CST 2014 -ngcf64) 403 | hostname 20-S5750-1 404 | ! 405 | ! 406 | ! 407 | ! 408 | ! 409 | ! 410 | ! 411 | nfpp 412 | ! 413 | ! 414 | vlan 1 415 | ! 416 | ! 417 | no service password-encryption 418 | ! 419 | ! 420 | ! 421 | ! 422 | ! 423 | ! 424 | ! 425 | ! 426 | interface GigabitEthernet 0/1 427 | ! 428 | interface GigabitEthernet 0/2 429 | ! 430 | interface GigabitEthernet 0/3 431 | ! 432 | interface GigabitEthernet 0/4 433 | ! 434 | interface GigabitEthernet 0/5 435 | ! 436 | interface GigabitEthernet 0/6 437 | no switchport 438 | no ip proxy-arp 439 | ip address 192.168.1.1 255.255.255.192 440 | ! 441 | interface GigabitEthernet 0/7 442 | ! 443 | interface GigabitEthernet 0/8 444 | no switchport 445 | no ip proxy-arp 446 | ip address 192.168.1.65 255.255.255.192 447 | ! 448 | interface GigabitEthernet 0/9 449 | ! 450 | interface GigabitEthernet 0/10 451 | ! 452 | interface GigabitEthernet 0/11 453 | ! 454 | interface GigabitEthernet 0/12 455 | ! 456 | interface GigabitEthernet 0/13 457 | ! 458 | interface GigabitEthernet 0/14 459 | ! 460 | interface GigabitEthernet 0/15 461 | ! 462 | interface GigabitEthernet 0/16 463 | ! 464 | interface GigabitEthernet 0/17 465 | ! 466 | interface GigabitEthernet 0/18 467 | ! 468 | interface GigabitEthernet 0/19 469 | ! 470 | interface GigabitEthernet 0/20 471 | ! 472 | interface GigabitEthernet 0/21 473 | ! 474 | interface GigabitEthernet 0/22 475 | ! 476 | interface GigabitEthernet 0/23 477 | ! 478 | interface GigabitEthernet 0/24 479 | ! 480 | interface GigabitEthernet 0/25 481 | ! 482 | interface GigabitEthernet 0/26 483 | ! 484 | interface GigabitEthernet 0/27 485 | ! 486 | interface GigabitEthernet 0/28 487 | ! 488 | ! 489 | ! 490 | ! 491 | ! 492 | ! 493 | ! 494 | ! 495 | ! 496 | router rip 497 | version 2 498 | network 192.168.1.0 499 | ! 500 | ! 501 | ! 502 | line con 0 503 | line vty 0 4 504 | login 505 | password b402 506 | ! 507 | ! 508 | end 509 | 510 | 511 | 512 | 513 | 514 | *************************************************************************** 515 | 【Switch 2】 516 | 517 | 20-S5750-2(config)#show running-config 518 | 519 | Building configuration... 520 | Current configuration : 1569 bytes 521 | 522 | ! 523 | version RGOS 10.4(2b12)p2 Release(180357)(Mon Dec 1 17:42:40 CST 2014 -ngcf64) 524 | hostname 20-S5750-2 525 | ! 526 | ! 527 | ! 528 | ! 529 | ! 530 | ! 531 | ! 532 | nfpp 533 | ! 534 | ! 535 | vlan 1 536 | ! 537 | ! 538 | no service password-encryption 539 | ! 540 | ! 541 | ! 542 | ! 543 | ! 544 | ! 545 | ! 546 | ! 547 | interface GigabitEthernet 0/1 548 | ! 549 | interface GigabitEthernet 0/2 550 | ! 551 | interface GigabitEthernet 0/3 552 | ! 553 | interface GigabitEthernet 0/4 554 | ! 555 | interface GigabitEthernet 0/5 556 | ! 557 | interface GigabitEthernet 0/6 558 | no switchport 559 | no ip proxy-arp 560 | ip address 192.168.1.194 255.255.255.192 561 | ! 562 | interface GigabitEthernet 0/7 563 | ! 564 | interface GigabitEthernet 0/8 565 | no switchport 566 | no ip proxy-arp 567 | ip address 192.168.1.66 255.255.255.192 568 | ! 569 | interface GigabitEthernet 0/9 570 | ! 571 | interface GigabitEthernet 0/10 572 | ! 573 | interface GigabitEthernet 0/11 574 | ! 575 | interface GigabitEthernet 0/12 576 | ! 577 | interface GigabitEthernet 0/13 578 | ! 579 | interface GigabitEthernet 0/14 580 | no switchport 581 | no ip proxy-arp 582 | ip address 192.168.3.130 255.255.255.0 583 | ! 584 | interface GigabitEthernet 0/15 585 | ! 586 | interface GigabitEthernet 0/16 587 | ! 588 | interface GigabitEthernet 0/17 589 | ! 590 | interface GigabitEthernet 0/18 591 | ! 592 | interface GigabitEthernet 0/19 593 | ! 594 | interface GigabitEthernet 0/20 595 | ! 596 | interface GigabitEthernet 0/21 597 | ! 598 | interface GigabitEthernet 0/22 599 | ! 600 | interface GigabitEthernet 0/23 601 | ! 602 | interface GigabitEthernet 0/24 603 | ! 604 | interface GigabitEthernet 0/25 605 | ! 606 | interface GigabitEthernet 0/26 607 | ! 608 | interface GigabitEthernet 0/27 609 | ! 610 | interface GigabitEthernet 0/28 611 | ! 612 | ! 613 | ! 614 | ! 615 | ! 616 | ! 617 | ! 618 | ! 619 | ! 620 | router rip 621 | version 2 622 | network 192.168.1.0 623 | network 192.168.3.0 624 | ! 625 | ! 626 | ! 627 | line con 0 628 | line vty 0 4 629 | login 630 | password b402 631 | ! 632 | ! 633 | end 634 | -------------------------------------------------------------------------------- /Configuring_配置实验/Conf5_RIP配置实验/s5.txt: -------------------------------------------------------------------------------- 1 | 【Router 1】 2 | 3 | 4 | 20-RSR20-1#show running-config 5 | 6 | Building configuration... 7 | Current configuration : 1955 bytes 8 | 9 | ! 10 | version RGOS 10.4(3b23) Release(176514)(Mon Jul 28 18:19:31 CST 2014 -ngcf62) 11 | hostname 20-RSR20-1 12 | webmaster level 0 username admin password 7 0121474e3e16 13 | ! 14 | ! 15 | ! 16 | ! 17 | ! 18 | ! 19 | diffserv domain default 20 | ! 21 | ! 22 | ! 23 | ! 24 | cwmp 25 | ! 26 | ! 27 | ! 28 | ! 29 | ! 30 | ! 31 | vlan 1 32 | ! 33 | ! 34 | no service password-encryption 35 | ! 36 | ! 37 | ! 38 | ! 39 | ! 40 | ! 41 | ! 42 | ! 43 | ! 44 | ! 45 | ! 46 | ! 47 | ! 48 | ! 49 | ! 50 | ! 51 | ! 52 | ! 53 | ! 54 | control-plane 55 | ! 56 | control-plane protocol 57 | no acpp 58 | ! 59 | control-plane manage 60 | no port-filter 61 | no arp-car 62 | no acpp 63 | ! 64 | control-plane data 65 | no glean-car 66 | no acpp 67 | ! 68 | ! 69 | ! 70 | ! 71 | enable service web-server http 72 | enable service web-server https 73 | ! 74 | ! 75 | ! 76 | ! 77 | ! 78 | ! 79 | ! 80 | ! 81 | ! 82 | ! 83 | ! 84 | ! 85 | ! 86 | ! 87 | ! 88 | interface Serial 2/0 89 | encapsulation HDLC 90 | clock rate 64000 91 | ! 92 | interface FastEthernet 1/0 93 | ! 94 | interface FastEthernet 1/1 95 | ! 96 | interface FastEthernet 1/2 97 | ! 98 | interface FastEthernet 1/3 99 | ! 100 | interface FastEthernet 1/4 101 | ! 102 | interface FastEthernet 1/5 103 | ! 104 | interface FastEthernet 1/6 105 | ! 106 | interface FastEthernet 1/7 107 | ! 108 | interface FastEthernet 1/8 109 | ! 110 | interface FastEthernet 1/9 111 | ! 112 | interface FastEthernet 1/10 113 | ! 114 | interface FastEthernet 1/11 115 | ! 116 | interface FastEthernet 1/12 117 | ! 118 | interface FastEthernet 1/13 119 | ! 120 | interface FastEthernet 1/14 121 | ! 122 | interface FastEthernet 1/15 123 | ! 124 | interface FastEthernet 1/16 125 | ! 126 | interface FastEthernet 1/17 127 | ! 128 | interface FastEthernet 1/18 129 | ! 130 | interface FastEthernet 1/19 131 | ! 132 | interface FastEthernet 1/20 133 | ! 134 | interface FastEthernet 1/21 135 | ! 136 | interface FastEthernet 1/22 137 | ! 138 | interface FastEthernet 1/23 139 | ! 140 | interface GigabitEthernet 0/0 141 | ip address 192.168.3.129 255.255.255.0 142 | duplex auto 143 | speed auto 144 | ! 145 | interface GigabitEthernet 0/1 146 | ip address 192.168.2.1 255.255.255.0 147 | duplex auto 148 | speed auto 149 | ! 150 | interface VLAN 1 151 | ! 152 | ! 153 | ! 154 | ! 155 | ! 156 | ! 157 | ! 158 | ! 159 | ! 160 | ! 161 | ! 162 | ! 163 | ! 164 | ! 165 | ! 166 | ! 167 | ! 168 | router rip 169 | version 2 170 | network 192.168.2.0 171 | network 192.168.3.0 172 | no auto-summary 173 | ! 174 | ! 175 | ! 176 | ! 177 | ! 178 | ! 179 | ! 180 | ! 181 | ref parameter 75 140 182 | line con 0 183 | line aux 0 184 | line tty 1 185 | modem InOut 186 | line vty 0 4 187 | login 188 | password b402 189 | ! 190 | ! 191 | end 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | *************************************************************************** 200 | 【Router 2】 201 | 202 | 203 | 20-RSR20-2#show running-config 204 | 205 | Building configuration... 206 | Current configuration : 2041 bytes 207 | 208 | ! 209 | version RGOS 10.4(3b23) Release(176514)(Mon Jul 28 18:19:31 CST 2014 -ngcf62) 210 | hostname 20-RSR20-2 211 | webmaster level 0 username admin password 7 1226011f4303 212 | ! 213 | ! 214 | ! 215 | ! 216 | ! 217 | ! 218 | diffserv domain default 219 | ! 220 | ! 221 | ! 222 | ! 223 | cwmp 224 | ! 225 | ! 226 | ! 227 | ! 228 | ! 229 | ! 230 | vlan 1 231 | ! 232 | ! 233 | no service password-encryption 234 | ! 235 | ! 236 | ! 237 | ! 238 | ! 239 | ! 240 | ! 241 | ! 242 | ! 243 | ! 244 | ! 245 | ! 246 | ! 247 | ! 248 | ! 249 | ! 250 | ! 251 | ! 252 | ! 253 | control-plane 254 | ! 255 | control-plane protocol 256 | no acpp 257 | ! 258 | control-plane manage 259 | no port-filter 260 | no arp-car 261 | no acpp 262 | ! 263 | control-plane data 264 | no glean-car 265 | no acpp 266 | ! 267 | ! 268 | ! 269 | ! 270 | enable service web-server http 271 | enable service web-server https 272 | ! 273 | ! 274 | ! 275 | ! 276 | ! 277 | ! 278 | ! 279 | ! 280 | ! 281 | ! 282 | ! 283 | ! 284 | ! 285 | ! 286 | ! 287 | interface Serial 2/0 288 | encapsulation HDLC 289 | ! 290 | interface Serial 3/0 291 | encapsulation HDLC 292 | clock rate 64000 293 | ! 294 | interface FastEthernet 1/0 295 | ! 296 | interface FastEthernet 1/1 297 | ! 298 | interface FastEthernet 1/2 299 | ! 300 | interface FastEthernet 1/3 301 | ! 302 | interface FastEthernet 1/4 303 | ! 304 | interface FastEthernet 1/5 305 | ! 306 | interface FastEthernet 1/6 307 | ! 308 | interface FastEthernet 1/7 309 | ! 310 | interface FastEthernet 1/8 311 | ! 312 | interface FastEthernet 1/9 313 | ! 314 | interface FastEthernet 1/10 315 | ! 316 | interface FastEthernet 1/11 317 | ! 318 | interface FastEthernet 1/12 319 | ! 320 | interface FastEthernet 1/13 321 | ! 322 | interface FastEthernet 1/14 323 | ! 324 | interface FastEthernet 1/15 325 | ! 326 | interface FastEthernet 1/16 327 | ! 328 | interface FastEthernet 1/17 329 | ! 330 | interface FastEthernet 1/18 331 | ! 332 | interface FastEthernet 1/19 333 | ! 334 | interface FastEthernet 1/20 335 | ! 336 | interface FastEthernet 1/21 337 | ! 338 | interface FastEthernet 1/22 339 | ! 340 | interface FastEthernet 1/23 341 | ! 342 | interface GigabitEthernet 0/0 343 | ip address 192.168.1.130 255.255.255.192 344 | duplex auto 345 | speed auto 346 | ! 347 | interface GigabitEthernet 0/1 348 | ip address 192.168.2.2 255.255.255.0 349 | duplex auto 350 | speed auto 351 | ! 352 | interface Loopback 0 353 | ip address 192.168.4.2 255.255.255.0 354 | ! 355 | interface VLAN 1 356 | ! 357 | ! 358 | ! 359 | ! 360 | ! 361 | ! 362 | ! 363 | ! 364 | ! 365 | ! 366 | ! 367 | ! 368 | ! 369 | ! 370 | ! 371 | ! 372 | ! 373 | router rip 374 | version 2 375 | network 192.168.1.0 376 | network 192.168.2.0 377 | no auto-summary 378 | ! 379 | ! 380 | ! 381 | ! 382 | ! 383 | ! 384 | ! 385 | ! 386 | ref parameter 75 140 387 | line con 0 388 | line aux 0 389 | line vty 0 4 390 | login 391 | password b402 392 | ! 393 | ! 394 | end 395 | 396 | 397 | 398 | 399 | 400 | *************************************************************************** 401 | 【Switch 1】 402 | 403 | 404 | 20-S5750-1#show running-config 405 | 406 | Building configuration... 407 | Current configuration : 1514 bytes 408 | 409 | ! 410 | version RGOS 10.4(2b12)p2 Release(180357)(Mon Dec 1 17:42:40 CST 2014 -ngcf64) 411 | hostname 20-S5750-1 412 | ! 413 | ! 414 | ! 415 | ! 416 | ! 417 | ! 418 | ! 419 | nfpp 420 | ! 421 | ! 422 | vlan 1 423 | ! 424 | ! 425 | no service password-encryption 426 | ! 427 | ! 428 | ! 429 | ! 430 | ! 431 | ! 432 | ! 433 | ! 434 | interface GigabitEthernet 0/1 435 | ! 436 | interface GigabitEthernet 0/2 437 | ! 438 | interface GigabitEthernet 0/3 439 | ! 440 | interface GigabitEthernet 0/4 441 | ! 442 | interface GigabitEthernet 0/5 443 | ! 444 | interface GigabitEthernet 0/6 445 | no switchport 446 | no ip proxy-arp 447 | ip address 192.168.1.1 255.255.255.192 448 | ! 449 | interface GigabitEthernet 0/7 450 | ! 451 | interface GigabitEthernet 0/8 452 | no switchport 453 | no ip rip split-horizon 454 | no ip proxy-arp 455 | ip address 192.168.1.65 255.255.255.192 456 | ! 457 | interface GigabitEthernet 0/9 458 | ! 459 | interface GigabitEthernet 0/10 460 | ! 461 | interface GigabitEthernet 0/11 462 | ! 463 | interface GigabitEthernet 0/12 464 | ! 465 | interface GigabitEthernet 0/13 466 | ! 467 | interface GigabitEthernet 0/14 468 | ! 469 | interface GigabitEthernet 0/15 470 | ! 471 | interface GigabitEthernet 0/16 472 | ! 473 | interface GigabitEthernet 0/17 474 | ! 475 | interface GigabitEthernet 0/18 476 | ! 477 | interface GigabitEthernet 0/19 478 | ! 479 | interface GigabitEthernet 0/20 480 | ! 481 | interface GigabitEthernet 0/21 482 | ! 483 | interface GigabitEthernet 0/22 484 | ! 485 | interface GigabitEthernet 0/23 486 | ! 487 | interface GigabitEthernet 0/24 488 | ! 489 | interface GigabitEthernet 0/25 490 | ! 491 | interface GigabitEthernet 0/26 492 | ! 493 | interface GigabitEthernet 0/27 494 | ! 495 | interface GigabitEthernet 0/28 496 | ! 497 | ! 498 | ! 499 | ! 500 | ! 501 | ! 502 | ! 503 | ! 504 | ! 505 | router rip 506 | version 2 507 | network 192.168.1.0 508 | no auto-summary 509 | ! 510 | ! 511 | ! 512 | line con 0 513 | line vty 0 4 514 | login 515 | password b402 516 | ! 517 | ! 518 | end 519 | 520 | 521 | 522 | 523 | *************************************************************************** 524 | 【Switch 2】 525 | 526 | 527 | 20-S5750-2#show running-config 528 | 529 | Building configuration... 530 | Current configuration : 1587 bytes 531 | 532 | ! 533 | version RGOS 10.4(2b12)p2 Release(180357)(Mon Dec 1 17:42:40 CST 2014 -ngcf64) 534 | hostname 20-S5750-2 535 | ! 536 | ! 537 | ! 538 | ! 539 | ! 540 | ! 541 | ! 542 | nfpp 543 | ! 544 | ! 545 | vlan 1 546 | ! 547 | ! 548 | no service password-encryption 549 | ! 550 | ! 551 | ! 552 | ! 553 | ! 554 | ! 555 | ! 556 | ! 557 | interface GigabitEthernet 0/1 558 | ! 559 | interface GigabitEthernet 0/2 560 | ! 561 | interface GigabitEthernet 0/3 562 | ! 563 | interface GigabitEthernet 0/4 564 | ! 565 | interface GigabitEthernet 0/5 566 | ! 567 | interface GigabitEthernet 0/6 568 | no switchport 569 | no ip proxy-arp 570 | ip address 192.168.1.194 255.255.255.192 571 | ! 572 | interface GigabitEthernet 0/7 573 | ! 574 | interface GigabitEthernet 0/8 575 | no switchport 576 | no ip proxy-arp 577 | ip address 192.168.1.66 255.255.255.192 578 | ! 579 | interface GigabitEthernet 0/9 580 | ! 581 | interface GigabitEthernet 0/10 582 | ! 583 | interface GigabitEthernet 0/11 584 | ! 585 | interface GigabitEthernet 0/12 586 | ! 587 | interface GigabitEthernet 0/13 588 | ! 589 | interface GigabitEthernet 0/14 590 | no switchport 591 | no ip proxy-arp 592 | ip address 192.168.3.130 255.255.255.0 593 | ! 594 | interface GigabitEthernet 0/15 595 | ! 596 | interface GigabitEthernet 0/16 597 | ! 598 | interface GigabitEthernet 0/17 599 | ! 600 | interface GigabitEthernet 0/18 601 | ! 602 | interface GigabitEthernet 0/19 603 | ! 604 | interface GigabitEthernet 0/20 605 | ! 606 | interface GigabitEthernet 0/21 607 | ! 608 | interface GigabitEthernet 0/22 609 | ! 610 | interface GigabitEthernet 0/23 611 | ! 612 | interface GigabitEthernet 0/24 613 | ! 614 | interface GigabitEthernet 0/25 615 | ! 616 | interface GigabitEthernet 0/26 617 | ! 618 | interface GigabitEthernet 0/27 619 | ! 620 | interface GigabitEthernet 0/28 621 | ! 622 | ! 623 | ! 624 | ! 625 | ! 626 | ! 627 | ! 628 | ! 629 | ! 630 | router rip 631 | version 2 632 | network 192.168.1.0 633 | network 192.168.3.0 634 | no auto-summary 635 | ! 636 | ! 637 | ! 638 | line con 0 639 | line vty 0 4 640 | login 641 | password b402 642 | ! 643 | ! 644 | end 645 | -------------------------------------------------------------------------------- /Configuring_配置实验/Conf5_RIP配置实验/s6.txt: -------------------------------------------------------------------------------- 1 | 【Router 1】 2 | 3 | 4 | 20-RSR20-1#show ip route 5 | 6 | Codes: C - connected, S - static, R - RIP, B - BGP 7 | O - OSPF, IA - OSPF inter area 8 | N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 9 | E1 - OSPF external type 1, E2 - OSPF external type 2 10 | i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 11 | ia - IS-IS inter area, * - candidate default 12 | 13 | Gateway of last resort is no set 14 | R 192.168.1.64/26 [120/1] via 192.168.3.130, 00:32:40, GigabitEthernet 0/0 15 | R 192.168.1.128/26 [120/1] via 192.168.2.2, 00:15:39, GigabitEthernet 0/1 16 | C 192.168.2.0/24 is directly connected, GigabitEthernet 0/1 17 | C 192.168.2.1/32 is local host. 18 | C 192.168.3.0/24 is directly connected, GigabitEthernet 0/0 19 | C 192.168.3.129/32 is local host. 20 | 20-RSR20-1#show r 21 | 20-RSR20-1#show ru 22 | 20-RSR20-1#show running-config 23 | 20-RSR20-1#show running-config 24 | 20-RSR20-1#show running-config 25 | 26 | Building configuration... 27 | Current configuration : 1955 bytes 28 | 29 | ! 30 | version RGOS 10.4(3b23) Release(176514)(Mon Jul 28 18:19:31 CST 2014 -ngcf62) 31 | hostname 20-RSR20-1 32 | webmaster level 0 username admin password 7 0121474e3e16 33 | ! 34 | ! 35 | ! 36 | ! 37 | ! 38 | ! 39 | diffserv domain default 40 | ! 41 | ! 42 | ! 43 | ! 44 | cwmp 45 | ! 46 | ! 47 | ! 48 | ! 49 | ! 50 | ! 51 | vlan 1 52 | ! 53 | ! 54 | no service password-encryption 55 | ! 56 | ! 57 | ! 58 | ! 59 | ! 60 | ! 61 | ! 62 | ! 63 | ! 64 | ! 65 | ! 66 | ! 67 | ! 68 | ! 69 | ! 70 | ! 71 | ! 72 | ! 73 | ! 74 | control-plane 75 | ! 76 | control-plane protocol 77 | no acpp 78 | ! 79 | control-plane manage 80 | no port-filter 81 | no arp-car 82 | no acpp 83 | ! 84 | control-plane data 85 | no glean-car 86 | no acpp 87 | ! 88 | ! 89 | ! 90 | ! 91 | enable service web-server http 92 | enable service web-server https 93 | ! 94 | ! 95 | ! 96 | ! 97 | ! 98 | ! 99 | ! 100 | ! 101 | ! 102 | ! 103 | ! 104 | ! 105 | ! 106 | ! 107 | ! 108 | interface Serial 2/0 109 | encapsulation HDLC 110 | clock rate 64000 111 | ! 112 | interface FastEthernet 1/0 113 | ! 114 | interface FastEthernet 1/1 115 | ! 116 | interface FastEthernet 1/2 117 | ! 118 | interface FastEthernet 1/3 119 | ! 120 | interface FastEthernet 1/4 121 | ! 122 | interface FastEthernet 1/5 123 | ! 124 | interface FastEthernet 1/6 125 | ! 126 | interface FastEthernet 1/7 127 | ! 128 | interface FastEthernet 1/8 129 | ! 130 | interface FastEthernet 1/9 131 | ! 132 | interface FastEthernet 1/10 133 | ! 134 | interface FastEthernet 1/11 135 | ! 136 | interface FastEthernet 1/12 137 | ! 138 | interface FastEthernet 1/13 139 | ! 140 | interface FastEthernet 1/14 141 | ! 142 | interface FastEthernet 1/15 143 | ! 144 | interface FastEthernet 1/16 145 | ! 146 | interface FastEthernet 1/17 147 | ! 148 | interface FastEthernet 1/18 149 | ! 150 | interface FastEthernet 1/19 151 | ! 152 | interface FastEthernet 1/20 153 | ! 154 | interface FastEthernet 1/21 155 | ! 156 | interface FastEthernet 1/22 157 | ! 158 | interface FastEthernet 1/23 159 | ! 160 | interface GigabitEthernet 0/0 161 | ip address 192.168.3.129 255.255.255.0 162 | duplex auto 163 | speed auto 164 | ! 165 | interface GigabitEthernet 0/1 166 | ip address 192.168.2.1 255.255.255.0 167 | duplex auto 168 | speed auto 169 | ! 170 | interface VLAN 1 171 | ! 172 | ! 173 | ! 174 | ! 175 | ! 176 | ! 177 | ! 178 | ! 179 | ! 180 | ! 181 | ! 182 | ! 183 | ! 184 | ! 185 | ! 186 | ! 187 | ! 188 | router rip 189 | version 2 190 | network 192.168.2.0 191 | network 192.168.3.0 192 | no auto-summary 193 | ! 194 | ! 195 | ! 196 | ! 197 | ! 198 | ! 199 | ! 200 | ! 201 | ref parameter 75 140 202 | line con 0 203 | line aux 0 204 | line tty 1 205 | modem InOut 206 | line vty 0 4 207 | login 208 | password b402 209 | ! 210 | ! 211 | end 212 | 213 | 214 | 215 | 216 | *************************************************************************** 217 | 【Router 2】 218 | 219 | 220 | 20-RSR20-2#show running-config 221 | 222 | Building configuration... 223 | Current configuration : 2041 bytes 224 | 225 | ! 226 | version RGOS 10.4(3b23) Release(176514)(Mon Jul 28 18:19:31 CST 2014 -ngcf62) 227 | hostname 20-RSR20-2 228 | webmaster level 0 username admin password 7 1226011f4303 229 | ! 230 | ! 231 | ! 232 | ! 233 | ! 234 | ! 235 | diffserv domain default 236 | ! 237 | ! 238 | ! 239 | ! 240 | cwmp 241 | ! 242 | ! 243 | ! 244 | ! 245 | ! 246 | ! 247 | vlan 1 248 | ! 249 | ! 250 | no service password-encryption 251 | ! 252 | ! 253 | ! 254 | ! 255 | ! 256 | ! 257 | ! 258 | ! 259 | ! 260 | ! 261 | ! 262 | ! 263 | ! 264 | ! 265 | ! 266 | ! 267 | ! 268 | ! 269 | ! 270 | control-plane 271 | ! 272 | control-plane protocol 273 | no acpp 274 | ! 275 | control-plane manage 276 | no port-filter 277 | no arp-car 278 | no acpp 279 | ! 280 | control-plane data 281 | no glean-car 282 | no acpp 283 | ! 284 | ! 285 | ! 286 | ! 287 | enable service web-server http 288 | enable service web-server https 289 | ! 290 | ! 291 | ! 292 | ! 293 | ! 294 | ! 295 | ! 296 | ! 297 | ! 298 | ! 299 | ! 300 | ! 301 | ! 302 | ! 303 | ! 304 | interface Serial 2/0 305 | encapsulation HDLC 306 | ! 307 | interface Serial 3/0 308 | encapsulation HDLC 309 | clock rate 64000 310 | ! 311 | interface FastEthernet 1/0 312 | ! 313 | interface FastEthernet 1/1 314 | ! 315 | interface FastEthernet 1/2 316 | ! 317 | interface FastEthernet 1/3 318 | ! 319 | interface FastEthernet 1/4 320 | ! 321 | interface FastEthernet 1/5 322 | ! 323 | interface FastEthernet 1/6 324 | ! 325 | interface FastEthernet 1/7 326 | ! 327 | interface FastEthernet 1/8 328 | ! 329 | interface FastEthernet 1/9 330 | ! 331 | interface FastEthernet 1/10 332 | ! 333 | interface FastEthernet 1/11 334 | ! 335 | interface FastEthernet 1/12 336 | ! 337 | interface FastEthernet 1/13 338 | ! 339 | interface FastEthernet 1/14 340 | ! 341 | interface FastEthernet 1/15 342 | ! 343 | interface FastEthernet 1/16 344 | ! 345 | interface FastEthernet 1/17 346 | ! 347 | interface FastEthernet 1/18 348 | ! 349 | interface FastEthernet 1/19 350 | ! 351 | interface FastEthernet 1/20 352 | ! 353 | interface FastEthernet 1/21 354 | ! 355 | interface FastEthernet 1/22 356 | ! 357 | interface FastEthernet 1/23 358 | ! 359 | interface GigabitEthernet 0/0 360 | ip address 192.168.1.130 255.255.255.192 361 | duplex auto 362 | speed auto 363 | ! 364 | interface GigabitEthernet 0/1 365 | ip address 192.168.2.2 255.255.255.0 366 | duplex auto 367 | speed auto 368 | ! 369 | interface Loopback 0 370 | ip address 192.168.4.2 255.255.255.0 371 | ! 372 | interface VLAN 1 373 | ! 374 | ! 375 | ! 376 | ! 377 | ! 378 | ! 379 | ! 380 | ! 381 | ! 382 | ! 383 | ! 384 | ! 385 | ! 386 | ! 387 | ! 388 | ! 389 | ! 390 | router rip 391 | version 2 392 | network 192.168.1.0 393 | network 192.168.2.0 394 | no auto-summary 395 | ! 396 | ! 397 | ! 398 | ! 399 | ! 400 | ! 401 | ! 402 | ! 403 | ref parameter 75 140 404 | line con 0 405 | line aux 0 406 | line vty 0 4 407 | login 408 | password b402 409 | ! 410 | ! 411 | end 412 | 413 | 414 | 415 | *************************************************************************** 416 | 【Switch 1】 417 | 418 | 20-S5750-1#show running-config 419 | 420 | Building configuration... 421 | Current configuration : 1514 bytes 422 | 423 | ! 424 | version RGOS 10.4(2b12)p2 Release(180357)(Mon Dec 1 17:42:40 CST 2014 -ngcf64) 425 | hostname 20-S5750-1 426 | ! 427 | ! 428 | ! 429 | ! 430 | ! 431 | ! 432 | ! 433 | nfpp 434 | ! 435 | ! 436 | vlan 1 437 | ! 438 | ! 439 | no service password-encryption 440 | ! 441 | ! 442 | ! 443 | ! 444 | ! 445 | ! 446 | ! 447 | ! 448 | interface GigabitEthernet 0/1 449 | ! 450 | interface GigabitEthernet 0/2 451 | ! 452 | interface GigabitEthernet 0/3 453 | ! 454 | interface GigabitEthernet 0/4 455 | ! 456 | interface GigabitEthernet 0/5 457 | ! 458 | interface GigabitEthernet 0/6 459 | no switchport 460 | no ip proxy-arp 461 | ip address 192.168.1.1 255.255.255.192 462 | ! 463 | interface GigabitEthernet 0/7 464 | ! 465 | interface GigabitEthernet 0/8 466 | no switchport 467 | no ip rip split-horizon 468 | no ip proxy-arp 469 | ip address 192.168.1.65 255.255.255.192 470 | ! 471 | interface GigabitEthernet 0/9 472 | ! 473 | interface GigabitEthernet 0/10 474 | ! 475 | interface GigabitEthernet 0/11 476 | ! 477 | interface GigabitEthernet 0/12 478 | ! 479 | interface GigabitEthernet 0/13 480 | ! 481 | interface GigabitEthernet 0/14 482 | ! 483 | interface GigabitEthernet 0/15 484 | ! 485 | interface GigabitEthernet 0/16 486 | ! 487 | interface GigabitEthernet 0/17 488 | ! 489 | interface GigabitEthernet 0/18 490 | ! 491 | interface GigabitEthernet 0/19 492 | ! 493 | interface GigabitEthernet 0/20 494 | ! 495 | interface GigabitEthernet 0/21 496 | ! 497 | interface GigabitEthernet 0/22 498 | ! 499 | interface GigabitEthernet 0/23 500 | ! 501 | interface GigabitEthernet 0/24 502 | ! 503 | interface GigabitEthernet 0/25 504 | ! 505 | interface GigabitEthernet 0/26 506 | ! 507 | interface GigabitEthernet 0/27 508 | ! 509 | interface GigabitEthernet 0/28 510 | ! 511 | ! 512 | ! 513 | ! 514 | ! 515 | ! 516 | ! 517 | ! 518 | ! 519 | router rip 520 | version 2 521 | network 192.168.1.0 522 | no auto-summary 523 | ! 524 | ! 525 | ! 526 | line con 0 527 | line vty 0 4 528 | login 529 | password b402 530 | ! 531 | ! 532 | end 533 | 534 | 535 | 536 | *************************************************************************** 537 | 【Switch 2】 538 | 539 | 540 | 20-S5750-2#show running-config 541 | 542 | Building configuration... 543 | Current configuration : 1587 bytes 544 | 545 | ! 546 | version RGOS 10.4(2b12)p2 Release(180357)(Mon Dec 1 17:42:40 CST 2014 -ngcf64) 547 | hostname 20-S5750-2 548 | ! 549 | ! 550 | ! 551 | ! 552 | ! 553 | ! 554 | ! 555 | nfpp 556 | ! 557 | ! 558 | vlan 1 559 | ! 560 | ! 561 | no service password-encryption 562 | ! 563 | ! 564 | ! 565 | ! 566 | ! 567 | ! 568 | ! 569 | ! 570 | interface GigabitEthernet 0/1 571 | ! 572 | interface GigabitEthernet 0/2 573 | ! 574 | interface GigabitEthernet 0/3 575 | ! 576 | interface GigabitEthernet 0/4 577 | ! 578 | interface GigabitEthernet 0/5 579 | ! 580 | interface GigabitEthernet 0/6 581 | no switchport 582 | no ip proxy-arp 583 | ip address 192.168.1.194 255.255.255.192 584 | ! 585 | interface GigabitEthernet 0/7 586 | ! 587 | interface GigabitEthernet 0/8 588 | no switchport 589 | no ip proxy-arp 590 | ip address 192.168.1.66 255.255.255.192 591 | ! 592 | interface GigabitEthernet 0/9 593 | ! 594 | interface GigabitEthernet 0/10 595 | ! 596 | interface GigabitEthernet 0/11 597 | ! 598 | interface GigabitEthernet 0/12 599 | ! 600 | interface GigabitEthernet 0/13 601 | ! 602 | interface GigabitEthernet 0/14 603 | no switchport 604 | no ip proxy-arp 605 | ip address 192.168.3.130 255.255.255.0 606 | ! 607 | interface GigabitEthernet 0/15 608 | ! 609 | interface GigabitEthernet 0/16 610 | ! 611 | interface GigabitEthernet 0/17 612 | ! 613 | interface GigabitEthernet 0/18 614 | ! 615 | interface GigabitEthernet 0/19 616 | ! 617 | interface GigabitEthernet 0/20 618 | ! 619 | interface GigabitEthernet 0/21 620 | ! 621 | interface GigabitEthernet 0/22 622 | ! 623 | interface GigabitEthernet 0/23 624 | ! 625 | interface GigabitEthernet 0/24 626 | ! 627 | interface GigabitEthernet 0/25 628 | ! 629 | interface GigabitEthernet 0/26 630 | ! 631 | interface GigabitEthernet 0/27 632 | ! 633 | interface GigabitEthernet 0/28 634 | ! 635 | ! 636 | ! 637 | ! 638 | ! 639 | ! 640 | ! 641 | ! 642 | ! 643 | router rip 644 | version 2 645 | network 192.168.1.0 646 | network 192.168.3.0 647 | no auto-summary 648 | ! 649 | ! 650 | ! 651 | line con 0 652 | line vty 0 4 653 | login 654 | password b402 655 | ! 656 | ! 657 | end 658 | 659 | -------------------------------------------------------------------------------- /Configuring_配置实验/Conf6_OSPF配置实验/OSPF配置实验.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Configuring_配置实验/Conf6_OSPF配置实验/OSPF配置实验.pdf -------------------------------------------------------------------------------- /Configuring_配置实验/Conf6_OSPF配置实验/README.md: -------------------------------------------------------------------------------- 1 | # OSPF 配置实验 2 | 3 | 2019.6.23 4 | 5 | 6 | 7 | ## 说明 8 | 9 | 本实验为配置实验,无需编程。报告文档见[OSPF配置实验.pdf](OSPF配置实验.pdf),仅供参考。 10 | 11 | -------------------------------------------------------------------------------- /Configuring_配置实验/Conf6_OSPF配置实验/s1.txt: -------------------------------------------------------------------------------- 1 | [Router 1] 2 | 3 | 4 | 20-RSR20-1(config-router)#show run 5 | 6 | Building configuration... 7 | Current configuration : 2094 bytes 8 | 9 | ! 10 | version RGOS 10.4(3b23) Release(176514)(Mon Jul 28 18:19:31 CST 2014 -ngcf62) 11 | hostname 20-RSR20-1 12 | webmaster level 0 username admin password 7 0121474e3e16 13 | ! 14 | ! 15 | ! 16 | ! 17 | ! 18 | ! 19 | diffserv domain default 20 | ! 21 | ! 22 | ! 23 | ! 24 | cwmp 25 | ! 26 | ! 27 | ! 28 | ! 29 | ! 30 | ! 31 | vlan 1 32 | ! 33 | ! 34 | no service password-encryption 35 | ! 36 | ! 37 | ! 38 | ! 39 | ! 40 | ! 41 | ! 42 | ! 43 | ! 44 | ! 45 | ! 46 | ! 47 | ! 48 | ! 49 | ! 50 | ! 51 | ! 52 | ! 53 | ! 54 | control-plane 55 | ! 56 | control-plane protocol 57 | no acpp 58 | ! 59 | control-plane manage 60 | no port-filter 61 | no arp-car 62 | no acpp 63 | ! 64 | control-plane data 65 | no glean-car 66 | no acpp 67 | ! 68 | ! 69 | ! 70 | ! 71 | enable service web-server http 72 | enable service web-server https 73 | ! 74 | ! 75 | ! 76 | ! 77 | ! 78 | ! 79 | ! 80 | ! 81 | ! 82 | ! 83 | ! 84 | ! 85 | ! 86 | ! 87 | ! 88 | interface Serial 2/0 89 | encapsulation HDLC 90 | clock rate 64000 91 | shutdown 92 | ! 93 | interface FastEthernet 1/0 94 | ! 95 | interface FastEthernet 1/1 96 | ! 97 | interface FastEthernet 1/2 98 | ! 99 | interface FastEthernet 1/3 100 | ! 101 | interface FastEthernet 1/4 102 | ! 103 | interface FastEthernet 1/5 104 | ! 105 | interface FastEthernet 1/6 106 | ! 107 | interface FastEthernet 1/7 108 | ! 109 | interface FastEthernet 1/8 110 | ! 111 | interface FastEthernet 1/9 112 | ! 113 | interface FastEthernet 1/10 114 | ! 115 | interface FastEthernet 1/11 116 | ! 117 | interface FastEthernet 1/12 118 | ! 119 | interface FastEthernet 1/13 120 | ! 121 | interface FastEthernet 1/14 122 | ! 123 | interface FastEthernet 1/15 124 | ! 125 | interface FastEthernet 1/16 126 | ! 127 | interface FastEthernet 1/17 128 | ! 129 | interface FastEthernet 1/18 130 | ! 131 | interface FastEthernet 1/19 132 | ! 133 | interface FastEthernet 1/20 134 | ! 135 | interface FastEthernet 1/21 136 | ! 137 | interface FastEthernet 1/22 138 | ! 139 | interface FastEthernet 1/23 140 | ! 141 | interface GigabitEthernet 0/0 142 | ip address 192.168.2.1 255.255.255.0 143 | duplex auto 144 | speed auto 145 | ! 146 | interface GigabitEthernet 0/1 147 | ip address 192.168.1.1 255.255.255.0 148 | duplex auto 149 | speed auto 150 | ! 151 | interface Loopback 0 152 | ip address 192.168.4.1 255.255.255.255 153 | ! 154 | interface VLAN 1 155 | ! 156 | ! 157 | ! 158 | ! 159 | ! 160 | ! 161 | ! 162 | ! 163 | ! 164 | ! 165 | ! 166 | ! 167 | ! 168 | ! 169 | ! 170 | ! 171 | router ospf 1 172 | router-id 6.6.6.6 173 | network 192.168.1.0 0.0.0.255 area 0 174 | network 192.168.2.0 0.0.0.255 area 0 175 | network 192.168.4.1 0.0.0.0 area 0 176 | ! 177 | ! 178 | ! 179 | ! 180 | ! 181 | ! 182 | ! 183 | ! 184 | ! 185 | ref parameter 75 140 186 | line con 0 187 | line aux 0 188 | line tty 1 189 | modem InOut 190 | line vty 0 4 191 | login 192 | password b402 193 | ! 194 | ! 195 | end 196 | 197 | 198 | 199 | 200 | ------------------------------------------------------------------------------ 201 | [Router 2] 202 | 203 | 204 | 20-RSR20-2(config-router)#show run 205 | 206 | Building configuration... 207 | Current configuration : 2000 bytes 208 | 209 | ! 210 | version RGOS 10.4(3b23) Release(176514)(Mon Jul 28 18:19:31 CST 2014 -ngcf62) 211 | hostname 20-RSR20-2 212 | webmaster level 0 username admin password 7 1226011f4303 213 | ! 214 | ! 215 | ! 216 | ! 217 | ! 218 | ! 219 | diffserv domain default 220 | ! 221 | ! 222 | ! 223 | ! 224 | cwmp 225 | ! 226 | ! 227 | ! 228 | ! 229 | ! 230 | ! 231 | vlan 1 232 | ! 233 | ! 234 | no service password-encryption 235 | ! 236 | ! 237 | ! 238 | ! 239 | ! 240 | ! 241 | ! 242 | ! 243 | ! 244 | ! 245 | ! 246 | ! 247 | ! 248 | ! 249 | ! 250 | ! 251 | ! 252 | ! 253 | ! 254 | control-plane 255 | ! 256 | control-plane protocol 257 | no acpp 258 | ! 259 | control-plane manage 260 | no port-filter 261 | no arp-car 262 | no acpp 263 | ! 264 | control-plane data 265 | no glean-car 266 | no acpp 267 | ! 268 | ! 269 | ! 270 | ! 271 | enable service web-server http 272 | enable service web-server https 273 | ! 274 | ! 275 | ! 276 | ! 277 | ! 278 | ! 279 | ! 280 | ! 281 | ! 282 | ! 283 | ! 284 | ! 285 | ! 286 | ! 287 | ! 288 | interface Serial 2/0 289 | encapsulation HDLC 290 | ! 291 | interface Serial 3/0 292 | encapsulation HDLC 293 | clock rate 64000 294 | ! 295 | interface FastEthernet 1/0 296 | ! 297 | interface FastEthernet 1/1 298 | ! 299 | interface FastEthernet 1/2 300 | ! 301 | interface FastEthernet 1/3 302 | ! 303 | interface FastEthernet 1/4 304 | ! 305 | interface FastEthernet 1/5 306 | ! 307 | interface FastEthernet 1/6 308 | ! 309 | interface FastEthernet 1/7 310 | ! 311 | interface FastEthernet 1/8 312 | ! 313 | interface FastEthernet 1/9 314 | ! 315 | interface FastEthernet 1/10 316 | ! 317 | interface FastEthernet 1/11 318 | ! 319 | interface FastEthernet 1/12 320 | ! 321 | interface FastEthernet 1/13 322 | ! 323 | interface FastEthernet 1/14 324 | ! 325 | interface FastEthernet 1/15 326 | ! 327 | interface FastEthernet 1/16 328 | ! 329 | interface FastEthernet 1/17 330 | ! 331 | interface FastEthernet 1/18 332 | ! 333 | interface FastEthernet 1/19 334 | ! 335 | interface FastEthernet 1/20 336 | ! 337 | interface FastEthernet 1/21 338 | ! 339 | interface FastEthernet 1/22 340 | ! 341 | interface FastEthernet 1/23 342 | ! 343 | interface GigabitEthernet 0/0 344 | ip address 192.168.2.2 255.255.255.0 345 | duplex auto 346 | speed auto 347 | ! 348 | interface GigabitEthernet 0/1 349 | ip address 192.168.3.1 255.255.255.0 350 | duplex auto 351 | speed auto 352 | ! 353 | interface VLAN 1 354 | ! 355 | ! 356 | ! 357 | ! 358 | ! 359 | ! 360 | ! 361 | ! 362 | ! 363 | ! 364 | ! 365 | ! 366 | ! 367 | ! 368 | ! 369 | ! 370 | router ospf 1 371 | router-id 6.6.6.7 372 | network 192.168.2.0 0.0.0.255 area 0 373 | network 192.168.3.0 0.0.0.255 area 0 374 | ! 375 | ! 376 | ! 377 | ! 378 | ! 379 | ! 380 | ! 381 | ! 382 | ! 383 | ref parameter 75 140 384 | line con 0 385 | line aux 0 386 | line vty 0 4 387 | login 388 | password b402 389 | ! 390 | ! 391 | end -------------------------------------------------------------------------------- /Configuring_配置实验/Conf7_综合组网实验/R1.txt: -------------------------------------------------------------------------------- 1 | 5-RSR20-1(config-if-GigabitEthernet 0/1)#show running-config 2 | 3 | Building configuration... 4 | Current configuration : 2298 bytes 5 | 6 | ! 7 | version RGOS 10.4(3b23) Release(176514)(Mon Jul 28 18:19:31 CST 2014 -ngcf62) 8 | hostname 5-RSR20-1 9 | webmaster level 0 username admin password 7 154b092c1b25 10 | ! 11 | ! 12 | ! 13 | ! 14 | ! 15 | ! 16 | diffserv domain default 17 | ! 18 | ! 19 | ! 20 | ! 21 | cwmp 22 | ! 23 | ! 24 | ! 25 | ! 26 | ! 27 | ! 28 | vlan 1 29 | ! 30 | ! 31 | no service password-encryption 32 | ! 33 | ! 34 | ! 35 | ! 36 | ! 37 | ! 38 | ! 39 | ! 40 | ! 41 | ! 42 | ! 43 | ! 44 | ! 45 | ! 46 | ! 47 | ! 48 | ip access-list standard 1 49 | 10 permit 192.168.1.0 0.0.0.255 50 | ! 51 | ! 52 | ! 53 | ! 54 | ! 55 | control-plane 56 | ! 57 | control-plane protocol 58 | no acpp 59 | ! 60 | control-plane manage 61 | no port-filter 62 | no arp-car 63 | no acpp 64 | ! 65 | control-plane data 66 | no glean-car 67 | no acpp 68 | ! 69 | ! 70 | ! 71 | ! 72 | enable service web-server http 73 | enable service web-server https 74 | ! 75 | ! 76 | ! 77 | ! 78 | ! 79 | ! 80 | ! 81 | ! 82 | ! 83 | ! 84 | ! 85 | ! 86 | ! 87 | ! 88 | ! 89 | interface Serial 2/0 90 | encapsulation HDLC 91 | ip nat inside 92 | ip address 192.168.1.129 255.255.255.192 93 | ! 94 | interface FastEthernet 1/0 95 | ! 96 | interface FastEthernet 1/1 97 | ! 98 | interface FastEthernet 1/2 99 | ! 100 | interface FastEthernet 1/3 101 | ! 102 | interface FastEthernet 1/4 103 | ! 104 | interface FastEthernet 1/5 105 | ! 106 | interface FastEthernet 1/6 107 | ! 108 | interface FastEthernet 1/7 109 | ! 110 | interface FastEthernet 1/8 111 | ! 112 | interface FastEthernet 1/9 113 | ! 114 | interface FastEthernet 1/10 115 | ! 116 | interface FastEthernet 1/11 117 | ! 118 | interface FastEthernet 1/12 119 | ! 120 | interface FastEthernet 1/13 121 | ! 122 | interface FastEthernet 1/14 123 | ! 124 | interface FastEthernet 1/15 125 | ! 126 | interface FastEthernet 1/16 127 | ! 128 | interface FastEthernet 1/17 129 | ! 130 | interface FastEthernet 1/18 131 | ! 132 | interface FastEthernet 1/19 133 | ! 134 | interface FastEthernet 1/20 135 | ! 136 | interface FastEthernet 1/21 137 | ! 138 | interface FastEthernet 1/22 139 | ! 140 | interface FastEthernet 1/23 141 | ! 142 | interface GigabitEthernet 0/0 143 | ip nat inside 144 | ip address 192.168.1.65 255.255.255.192 145 | duplex auto 146 | speed auto 147 | ! 148 | interface GigabitEthernet 0/1 149 | ip nat outside 150 | ip address 172.16.5.17 255.255.0.0 151 | duplex auto 152 | speed auto 153 | ! 154 | interface VLAN 1 155 | ! 156 | ip nat pool g5 172.16.5.1 172.16.5.1 netmask 255.255.0.0 157 | ip nat inside source list 1 pool g5 overload 158 | ! 159 | ! 160 | ! 161 | ! 162 | ! 163 | ! 164 | ! 165 | ! 166 | ! 167 | ! 168 | ! 169 | ! 170 | ! 171 | ! 172 | ! 173 | router ospf 1 174 | router-id 6.6.6.6 175 | network 192.168.1.64 0.0.0.63 area 0 176 | network 192.168.1.128 0.0.0.63 area 0 177 | default-information originate 178 | ! 179 | ! 180 | ! 181 | ! 182 | ! 183 | ip route 0.0.0.0 0.0.0.0 172.16.0.1 184 | ! 185 | ! 186 | ! 187 | ! 188 | ! 189 | ref parameter 75 140 190 | line con 0 191 | line aux 0 192 | line tty 1 193 | modem InOut 194 | line vty 0 4 195 | login 196 | password b402 197 | ! 198 | ! 199 | end -------------------------------------------------------------------------------- /Configuring_配置实验/Conf7_综合组网实验/R2.txt: -------------------------------------------------------------------------------- 1 | 5-RSR20-2(config)#show ip route 2 | 3 | Codes: C - connected, S - static, R - RIP, B - BGP 4 | O - OSPF, IA - OSPF inter area 5 | N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 6 | E1 - OSPF external type 1, E2 - OSPF external type 2 7 | i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 8 | ia - IS-IS inter area, * - candidate default 9 | 10 | Gateway of last resort is 192.168.1.129 to network 0.0.0.0 11 | O*E2 0.0.0.0/0 [110/1] via 192.168.1.129, 00:10:46, Serial 2/0 12 | O 192.168.1.0/26 [110/52] via 192.168.1.129, 00:40:41, Serial 2/0 13 | O 192.168.1.64/26 [110/51] via 192.168.1.129, 00:43:26, Serial 2/0 14 | C 192.168.1.128/26 is directly connected, Serial 2/0 15 | C 192.168.1.130/32 is local host. 16 | C 192.168.1.192/26 is directly connected, GigabitEthernet 0/1 17 | C 192.168.1.194/32 is local host. 18 | 5-RSR20-2(config)#show ip ro 19 | 5-RSR20-2(config)#show ip route 20 | 21 | Codes: C - connected, S - static, R - RIP, B - BGP 22 | O - OSPF, IA - OSPF inter area 23 | N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 24 | E1 - OSPF external type 1, E2 - OSPF external type 2 25 | i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 26 | ia - IS-IS inter area, * - candidate default 27 | 28 | Gateway of last resort is 192.168.1.129 to network 0.0.0.0 29 | O*E2 0.0.0.0/0 [110/1] via 192.168.1.129, 00:15:38, Serial 2/0 30 | O 192.168.1.0/26 [110/52] via 192.168.1.129, 00:45:33, Serial 2/0 31 | O 192.168.1.64/26 [110/51] via 192.168.1.129, 00:48:18, Serial 2/0 32 | C 192.168.1.128/26 is directly connected, Serial 2/0 33 | C 192.168.1.130/32 is local host. 34 | C 192.168.1.192/26 is directly connected, GigabitEthernet 0/1 35 | C 192.168.1.194/32 is local host. 36 | 5-RSR20-2(config)#show ru 37 | 5-RSR20-2(config)#show running-config 38 | 39 | Building configuration... 40 | Current configuration : 2028 bytes 41 | 42 | ! 43 | version RGOS 10.4(3b23) Release(176514)(Mon Jul 28 18:19:31 CST 2014 -ngcf62) 44 | hostname 5-RSR20-2 45 | webmaster level 0 username admin password 7 04361c0b370d 46 | ! 47 | ! 48 | ! 49 | ! 50 | ! 51 | ! 52 | diffserv domain default 53 | ! 54 | ! 55 | ! 56 | ! 57 | cwmp 58 | ! 59 | ! 60 | ! 61 | ! 62 | ! 63 | ! 64 | vlan 1 65 | ! 66 | ! 67 | no service password-encryption 68 | ! 69 | ! 70 | ! 71 | ! 72 | ! 73 | ! 74 | ! 75 | ! 76 | ! 77 | ! 78 | ! 79 | ! 80 | ! 81 | ! 82 | ! 83 | ! 84 | ! 85 | ! 86 | ! 87 | control-plane 88 | ! 89 | control-plane protocol 90 | no acpp 91 | ! 92 | control-plane manage 93 | no port-filter 94 | no arp-car 95 | no acpp 96 | ! 97 | control-plane data 98 | no glean-car 99 | no acpp 100 | ! 101 | ! 102 | ! 103 | ! 104 | enable service web-server http 105 | enable service web-server https 106 | ! 107 | ! 108 | ! 109 | ! 110 | ! 111 | ! 112 | ! 113 | ! 114 | ! 115 | ! 116 | ! 117 | ! 118 | ! 119 | ! 120 | ! 121 | interface Serial 2/0 122 | encapsulation HDLC 123 | ip address 192.168.1.130 255.255.255.192 124 | clock rate 64000 125 | ! 126 | interface Serial 3/0 127 | encapsulation HDLC 128 | clock rate 64000 129 | ! 130 | interface FastEthernet 1/0 131 | ! 132 | interface FastEthernet 1/1 133 | ! 134 | interface FastEthernet 1/2 135 | ! 136 | interface FastEthernet 1/3 137 | ! 138 | interface FastEthernet 1/4 139 | ! 140 | interface FastEthernet 1/5 141 | ! 142 | interface FastEthernet 1/6 143 | ! 144 | interface FastEthernet 1/7 145 | ! 146 | interface FastEthernet 1/8 147 | ! 148 | interface FastEthernet 1/9 149 | ! 150 | interface FastEthernet 1/10 151 | ! 152 | interface FastEthernet 1/11 153 | ! 154 | interface FastEthernet 1/12 155 | ! 156 | interface FastEthernet 1/13 157 | ! 158 | interface FastEthernet 1/14 159 | ! 160 | interface FastEthernet 1/15 161 | ! 162 | interface FastEthernet 1/16 163 | ! 164 | interface FastEthernet 1/17 165 | ! 166 | interface FastEthernet 1/18 167 | ! 168 | interface FastEthernet 1/19 169 | ! 170 | interface FastEthernet 1/20 171 | ! 172 | interface FastEthernet 1/21 173 | ! 174 | interface FastEthernet 1/22 175 | ! 176 | interface FastEthernet 1/23 177 | ! 178 | interface GigabitEthernet 0/0 179 | duplex auto 180 | speed auto 181 | ! 182 | interface GigabitEthernet 0/1 183 | ip address 192.168.1.194 255.255.255.192 184 | duplex auto 185 | speed auto 186 | ! 187 | interface VLAN 1 188 | ! 189 | ! 190 | ! 191 | ! 192 | ! 193 | ! 194 | ! 195 | ! 196 | ! 197 | ! 198 | ! 199 | ! 200 | ! 201 | ! 202 | ! 203 | ! 204 | router ospf 1 205 | router-id 6.6.6.7 206 | network 192.168.1.128 0.0.0.63 area 0 207 | network 192.168.1.192 0.0.0.63 area 0 208 | ! 209 | ! 210 | ! 211 | ! 212 | ! 213 | ! 214 | ! 215 | ! 216 | ! 217 | ref parameter 75 140 218 | line con 0 219 | line aux 0 220 | line vty 0 4 221 | login 222 | password b402 223 | ! 224 | ! 225 | end 226 | -------------------------------------------------------------------------------- /Configuring_配置实验/Conf7_综合组网实验/README.md: -------------------------------------------------------------------------------- 1 | # 综合组网实验 2 | 3 | 2019.6.30 4 | 5 | 6 | 7 | ## 说明 8 | 9 | 本实验为配置实验,无需编程。报告文档见[综合组网实验.pdf](综合组网实验.pdf),仅供参考。 10 | 11 | -------------------------------------------------------------------------------- /Configuring_配置实验/Conf7_综合组网实验/S1.txt: -------------------------------------------------------------------------------- 1 | 9-S5750-1(config)#show running-config 2 | 3 | Building configuration... 4 | Current configuration : 1401 bytes 5 | 6 | ! 7 | version RGOS 10.4(2b12)p2 Release(180357)(Mon Dec 1 17:42:40 CST 2014 -ngcf64) 8 | hostname 9-S5750-1 9 | ! 10 | ! 11 | ! 12 | ! 13 | ! 14 | ! 15 | ! 16 | nfpp 17 | ! 18 | ! 19 | vlan 1 20 | ! 21 | vlan 10 22 | ! 23 | vlan 20 24 | ! 25 | ! 26 | no service password-encryption 27 | ! 28 | ! 29 | ! 30 | ! 31 | ! 32 | ! 33 | ! 34 | ! 35 | interface GigabitEthernet 0/1 36 | ! 37 | interface GigabitEthernet 0/2 38 | ! 39 | interface GigabitEthernet 0/3 40 | ! 41 | interface GigabitEthernet 0/4 42 | ! 43 | interface GigabitEthernet 0/5 44 | ! 45 | interface GigabitEthernet 0/6 46 | switchport mode trunk 47 | ! 48 | interface GigabitEthernet 0/7 49 | ! 50 | interface GigabitEthernet 0/8 51 | ! 52 | interface GigabitEthernet 0/9 53 | ! 54 | interface GigabitEthernet 0/10 55 | switchport access vlan 10 56 | ! 57 | interface GigabitEthernet 0/11 58 | ! 59 | interface GigabitEthernet 0/12 60 | ! 61 | interface GigabitEthernet 0/13 62 | ! 63 | interface GigabitEthernet 0/14 64 | ! 65 | interface GigabitEthernet 0/15 66 | switchport access vlan 20 67 | ! 68 | interface GigabitEthernet 0/16 69 | ! 70 | interface GigabitEthernet 0/17 71 | ! 72 | interface GigabitEthernet 0/18 73 | ! 74 | interface GigabitEthernet 0/19 75 | ! 76 | interface GigabitEthernet 0/20 77 | switchport access vlan 20 78 | ! 79 | interface GigabitEthernet 0/21 80 | ! 81 | interface GigabitEthernet 0/22 82 | ! 83 | interface GigabitEthernet 0/23 84 | ! 85 | interface GigabitEthernet 0/24 86 | ! 87 | interface GigabitEthernet 0/25 88 | ! 89 | interface GigabitEthernet 0/26 90 | ! 91 | interface GigabitEthernet 0/27 92 | ! 93 | interface GigabitEthernet 0/28 94 | ! 95 | ! 96 | ! 97 | ! 98 | ! 99 | ! 100 | ! 101 | ! 102 | ! 103 | ! 104 | ! 105 | line con 0 106 | line vty 0 4 107 | login 108 | password b402 109 | ! 110 | ! 111 | end -------------------------------------------------------------------------------- /Configuring_配置实验/Conf7_综合组网实验/S2.txt: -------------------------------------------------------------------------------- 1 | 5-S5750-2(config)#show ip route 2 | 3 | Codes: C - connected, S - static, R - RIP, B - BGP 4 | O - OSPF, IA - OSPF inter area 5 | N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 6 | E1 - OSPF external type 1, E2 - OSPF external type 2 7 | i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 8 | ia - IS-IS inter area, * - candidate default 9 | 10 | Gateway of last resort is 192.168.1.65 to network 0.0.0.0 11 | O*E2 0.0.0.0/0 [110/1] via 192.168.1.65, 00:11:25, VLAN 20 12 | C 192.168.1.0/26 is directly connected, VLAN 10 13 | C 192.168.1.62/32 is local host. 14 | C 192.168.1.64/26 is directly connected, VLAN 20 15 | C 192.168.1.126/32 is local host. 16 | O 192.168.1.128/26 [110/51] via 192.168.1.65, 00:41:18, VLAN 20 17 | O 192.168.1.192/26 [110/52] via 192.168.1.65, 00:41:18, VLAN 20 18 | 5-S5750-2(config)#show ip ro 19 | 5-S5750-2(config)#show ip route 20 | 21 | Codes: C - connected, S - static, R - RIP, B - BGP 22 | O - OSPF, IA - OSPF inter area 23 | N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 24 | E1 - OSPF external type 1, E2 - OSPF external type 2 25 | i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 26 | ia - IS-IS inter area, * - candidate default 27 | 28 | Gateway of last resort is 192.168.1.65 to network 0.0.0.0 29 | O*E2 0.0.0.0/0 [110/1] via 192.168.1.65, 00:16:10, VLAN 20 30 | C 192.168.1.0/26 is directly connected, VLAN 10 31 | C 192.168.1.62/32 is local host. 32 | C 192.168.1.64/26 is directly connected, VLAN 20 33 | C 192.168.1.126/32 is local host. 34 | O 192.168.1.128/26 [110/51] via 192.168.1.65, 00:46:02, VLAN 20 35 | O 192.168.1.192/26 [110/52] via 192.168.1.65, 00:46:02, VLAN 20 36 | 5-S5750-2(config)#show run 37 | 5-S5750-2(config)#show running-config 38 | 39 | Building configuration... 40 | Current configuration : 1625 bytes 41 | 42 | ! 43 | version RGOS 10.4(2b12)p2 Release(180357)(Mon Dec 1 17:42:40 CST 2014 -ngcf64) 44 | hostname 5-S5750-2 45 | ! 46 | ! 47 | ! 48 | ! 49 | ! 50 | ! 51 | ! 52 | nfpp 53 | ! 54 | ! 55 | vlan 1 56 | ! 57 | vlan 10 58 | ! 59 | vlan 20 60 | ! 61 | ! 62 | no service password-encryption 63 | ! 64 | ! 65 | ! 66 | ! 67 | ! 68 | ! 69 | ! 70 | ! 71 | interface GigabitEthernet 0/1 72 | ! 73 | interface GigabitEthernet 0/2 74 | ! 75 | interface GigabitEthernet 0/3 76 | ! 77 | interface GigabitEthernet 0/4 78 | ! 79 | interface GigabitEthernet 0/5 80 | ! 81 | interface GigabitEthernet 0/6 82 | switchport mode trunk 83 | ! 84 | interface GigabitEthernet 0/7 85 | ! 86 | interface GigabitEthernet 0/8 87 | ! 88 | interface GigabitEthernet 0/9 89 | ! 90 | interface GigabitEthernet 0/10 91 | switchport access vlan 10 92 | ! 93 | interface GigabitEthernet 0/11 94 | ! 95 | interface GigabitEthernet 0/12 96 | ! 97 | interface GigabitEthernet 0/13 98 | ! 99 | interface GigabitEthernet 0/14 100 | ! 101 | interface GigabitEthernet 0/15 102 | ! 103 | interface GigabitEthernet 0/16 104 | ! 105 | interface GigabitEthernet 0/17 106 | ! 107 | interface GigabitEthernet 0/18 108 | ! 109 | interface GigabitEthernet 0/19 110 | ! 111 | interface GigabitEthernet 0/20 112 | ! 113 | interface GigabitEthernet 0/21 114 | ! 115 | interface GigabitEthernet 0/22 116 | ! 117 | interface GigabitEthernet 0/23 118 | ! 119 | interface GigabitEthernet 0/24 120 | ! 121 | interface GigabitEthernet 0/25 122 | ! 123 | interface GigabitEthernet 0/26 124 | ! 125 | interface GigabitEthernet 0/27 126 | ! 127 | interface GigabitEthernet 0/28 128 | ! 129 | interface VLAN 10 130 | no ip proxy-arp 131 | ip address 192.168.1.62 255.255.255.192 132 | ! 133 | interface VLAN 20 134 | no ip proxy-arp 135 | ip address 192.168.1.126 255.255.255.192 136 | ! 137 | ! 138 | ! 139 | ! 140 | ! 141 | ! 142 | ! 143 | ! 144 | router ospf 1 145 | router-id 6.6.6.8 146 | network 192.168.1.0 0.0.0.63 area 0 147 | network 192.168.1.64 0.0.0.63 area 0 148 | ! 149 | ! 150 | ! 151 | ! 152 | line con 0 153 | line vty 0 4 154 | login 155 | password b402 156 | ! 157 | ! 158 | end -------------------------------------------------------------------------------- /Configuring_配置实验/Conf7_综合组网实验/综合组网实验.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Configuring_配置实验/Conf7_综合组网实验/综合组网实验.pdf -------------------------------------------------------------------------------- /Configuring_配置实验/配置实验查错方法.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Configuring_配置实验/配置实验查错方法.pdf -------------------------------------------------------------------------------- /Programming_编程实验/Prog1_数据表示实验/README.md: -------------------------------------------------------------------------------- 1 | # 数据表示实验 2 | 3 | 2019-03-09 4 | 5 | 报告文档:[数据表示实验.pdf](数据表示实验.pdf) 6 | 7 | 8 | 9 | ## 任务一 10 | 11 | 命名为`StructSave.c`。 12 | 13 | 循环输入员工(Person)的信息,每输入一个员工的信息,立即写入文件`Persons.stru`,直到输入的姓名为空时跳出循环。然后,读出该文件,显示每个 Person 的信息。 14 | 15 | 16 | 17 | ## 任务二 18 | 19 | 命名为`FilePack.c`。 20 | 21 | 循环输入多个文件名(不超过 200MB,可以自己确定),每输入一个,就把该文件的文件名(最多300字节)、文件大小和文件内容写入文件`FileSet.pak`中,输入文件名为空时跳出循环。然后,读`FileSet.pak`,每读出一个文件就把它保存起来,**有重名文件存在时文件名加上序号(从2开始)**。 22 | 23 | 提示:合并时可以先取得文件大小,然后边读边写。 24 | 25 | 26 | 27 | ## 参考资料 28 | 29 | http://www.runoob.com/cprogramming/c-file-io.html -------------------------------------------------------------------------------- /Programming_编程实验/Prog1_数据表示实验/src/FilePack.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog1_数据表示实验/src/FilePack.c -------------------------------------------------------------------------------- /Programming_编程实验/Prog1_数据表示实验/src/StructSave.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog1_数据表示实验/src/StructSave.c -------------------------------------------------------------------------------- /Programming_编程实验/Prog1_数据表示实验/数据表示实验.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog1_数据表示实验/数据表示实验.pdf -------------------------------------------------------------------------------- /Programming_编程实验/Prog2_Echo实验/Echo实验.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog2_Echo实验/Echo实验.pdf -------------------------------------------------------------------------------- /Programming_编程实验/Prog2_Echo实验/README.md: -------------------------------------------------------------------------------- 1 | # Echo 实验 2 | 3 | 2019.3.16 4 | 5 | 报告文档:[Echo实验.pdf](Echo实验.pdf) 6 | 7 | ## 任务一:编写 TCP Echo 程序 8 | 9 | 服务器把客户端发送来的任何消息都返回给客户端,返回的消息前面要加上服务器的当前时间。客户端把返回的消息显示出来。客户端每输入一条消息就建立 TCP 连接,并把消息发送给服务器,在收到服务器回应后关闭连接。 10 | 11 | 12 | 13 | ## 任务二:编写 TCP Echo 增强程序 14 | 15 | 在任务一的基础上,服务器在收到客户端的消息时显示服务器的当前时间、客户端的IP地址、客户端的端口号和客户端发来的信息,并把它们一并返回给客户端。 16 | 客户端在发送消息后把服务器发回给它的消息显示出来。 17 | 18 | 提示:客户端程序与任务一同,不用修改 19 | 20 | 要求服务器直接从`accept()`的参数中得到客户端的IP地址和端口号。注:服务器获取IP地址后要求直接使用`s_un_b`的四个分量得到IP地址,不能使用函数`inet_ntoa()`转换IP地址。 21 | 22 | 23 | 24 | ## 任务三:编写 UDP Echo 增强程序 25 | 26 | 修改UDP例程,完成Echo功能,即当客户端发来消息时,服务器显示出服务器的当前时间、客户端的IP、客户端的端口号和客户发来的信息,并把它们一并发回给客户端,客户端然后把它们显示出来。 27 | 服务器可以直接从`recvfrom()`的参数`from`中得到客户端的IP地址和端口号,并且服务器用`sendto()`发回给客户端消息时可以直接用该参数`from`作为参数`toAddr`。可以使用`inet_ntoa()`转换客户端IP地址。 28 | 客户端程序的`recvfrom()`可以直接使用原来`sendto`使用的sock。该sock已经绑定了客户端的IP地址和端口号,客户端可以直接用来接收数据。 29 | 30 | 31 | 32 | ## 目录结构 33 | 34 | ``` 35 | src 36 | │ 37 | ├───TCP 38 | │ ├───可执行文件 39 | │ │ TcpEcho_Client.exe 40 | │ │ TcpEcho_Server.exe 41 | │ │ TcpEcho_Server_Enhanced.exe 42 | │ │ 43 | │ └───源码 44 | │ TcpEcho_Client.c 45 | │ TcpEcho_Server.c 46 | │ TcpEcho_Server_Enhanced.cpp 47 | │ 48 | └───UDP 49 | ├───可执行文件 50 | │ UdpEcho_Client.exe 51 | │ UdpEcho_Server.exe 52 | │ 53 | └───源码 54 | UdpEcho_Client.c 55 | UdpEcho_Server.cpp 56 | ``` 57 | 58 | 59 | 60 | ## 实验总结 61 | 62 | ### TCP 编程步骤 63 | 64 | #### TCP 服务器端编程的步骤 65 | 66 | 1. 加载套接字库,创建套接字`WSAStartup()`/`socket()`; 67 | 2. 绑定套接字到一个IP地址和一个端口上`bind()`; 68 | 3. 将套接字设置为监听模步等待连接请求`listen()`; 69 | 4. 请求到来后,接受连接请求,返回一个新的对应于此次连接的套接字`accept()`; 70 | 5. 用返回的套接字和客户端进行通信`send()`/`recv()`; 71 | 6. 返回,等待另一连接请求; 72 | 7. 关闭套接字,关闭加载的套接字库`closesocket()`/`WSACleanup()`。 73 | 74 | 75 | 76 | #### TCP 客户端编程的步骤 77 | 78 | 1. 加载套接字库,创建套接字`WSAStartup()`/`socket()`; 79 | 2. 向服务器发出连接请求`connect()`; 80 | 3. 和服务器端进行通信`send()`/`recv()`; 81 | 4. 关闭套接字,关闭加载的套接字库`closesocket()`/`WSACleanup()`。 82 | 83 | 84 | 85 | ### UDP 编程步骤 86 | 87 | * 与 TCP 类似,不过 UDP 不需要建立连接(`accept()`/`connect()`)。 88 | 89 | * 发送函数为`sendto()`,接收函数为`recvfrom()`。 90 | 91 | 92 | 93 | ## 参考资料 94 | 95 | [windows socket函数详解](https://www.cnblogs.com/hgwang/p/6074038.html) 96 | 97 | [Getting Started with Winsock](https://docs.microsoft.com/en-us/windows/desktop/winsock/getting-started-with-winsock) -------------------------------------------------------------------------------- /Programming_编程实验/Prog2_Echo实验/src/TCP/TcpEcho_Client.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog2_Echo实验/src/TCP/TcpEcho_Client.c -------------------------------------------------------------------------------- /Programming_编程实验/Prog2_Echo实验/src/TCP/TcpEcho_Server.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog2_Echo实验/src/TCP/TcpEcho_Server.c -------------------------------------------------------------------------------- /Programming_编程实验/Prog2_Echo实验/src/TCP/TcpEcho_Server_Enhanced.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog2_Echo实验/src/TCP/TcpEcho_Server_Enhanced.cpp -------------------------------------------------------------------------------- /Programming_编程实验/Prog2_Echo实验/src/UDP/UdpEcho_Client.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog2_Echo实验/src/UDP/UdpEcho_Client.c -------------------------------------------------------------------------------- /Programming_编程实验/Prog2_Echo实验/src/UDP/UdpEcho_Server.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog2_Echo实验/src/UDP/UdpEcho_Server.cpp -------------------------------------------------------------------------------- /Programming_编程实验/Prog3_Chat实验/Chat实验.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog3_Chat实验/Chat实验.pdf -------------------------------------------------------------------------------- /Programming_编程实验/Prog3_Chat实验/GroupChat_Client/client.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: Jed 3 | * @Description: client.cpp 4 | * @Date: 2019-03-23 5 | * @LastEditTime: 2019-03-23 6 | */ 7 | #include "client.h" 8 | 9 | int main(int argc, char *argv[]) 10 | { 11 | printf("[Group Chat Client]\n群聊客户端正在连接服务器..."); 12 | 13 | const char *host = "127.0.0.1"; // server IP to connect 14 | u_short port = 50500; // server port to connect 15 | struct sockaddr_in sin; // an Internet endpoint address 16 | char buf[BUFLEN + 1]; // buffer for one line of text 17 | SOCKET sock; // socket descriptor 18 | int cc; // recv character count 19 | 20 | WSADATA wsadata; 21 | WSAStartup(MAKEWORD(2, 0), &wsadata); //加载winsock library 22 | 23 | sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); //创建套接字,参数:因特网协议簇(family),流套接字,TCP协议 24 | memset(&sin, 0, sizeof(sin)); // 从&sin开始的长度为sizeof(sin)的内存清0 25 | sin.sin_family = AF_INET; // 因特网地址簇 26 | sin.sin_addr.s_addr = inet_addr(host); // 服务器IP地址(32位) 27 | sin.sin_port = htons(port); // 服务器端口号 28 | if (connect(sock, (struct sockaddr *)&sin, sizeof(sin)) == 0) { // 连接到服务器 29 | printf("连接成功!\n\n"); 30 | printf("***************************************\n"); 31 | } 32 | else { 33 | printf("失败:%d\n", GetLastError()); 34 | printf("[-] 请检查网络连接,并确认服务器已启动。按任意键关闭客户端。\n"); 35 | getchar(); 36 | exit(1); 37 | } 38 | 39 | HANDLE recv_thread = (HANDLE)_beginthreadex(NULL, 0, &recvThread, (void *)&sock, 0, NULL); 40 | while (1) 41 | { 42 | fgets(buf, BUFLEN, stdin); 43 | buf[strlen(buf) - 1] = '\0'; // 把换行符替换为空字符 44 | if (std::string(buf) == "exit") {// 用户输入了exit,正常退出 45 | break; 46 | } 47 | int sendlen = send(sock, buf, strlen(buf) + 1, 0); 48 | } 49 | 50 | CloseHandle(recv_thread); 51 | closesocket(sock); // 关闭监听套接字 52 | WSACleanup(); // 卸载winsock library 53 | 54 | printf("按回车键继续..."); 55 | getchar(); 56 | 57 | return 0; 58 | } 59 | 60 | unsigned __stdcall recvThread(void *p) 61 | { 62 | char buf[BUFLEN + 1]; // 接收缓冲区 63 | 64 | SOCKET sock = *(SOCKET *)p; 65 | while (1) 66 | { 67 | printf(">>> ");// 提示符 68 | int recvlen = recv(sock, buf, BUFLEN, 0); 69 | printf("\r");// 回到行首,覆盖掉之前显示的提示符 70 | if (recvlen == SOCKET_ERROR) 71 | { 72 | printf("[-] Error: %ld. 按任意键关闭客户端。\n", GetLastError()); 73 | getchar(); 74 | exit(1); 75 | } 76 | else if (recvlen == 0) 77 | { 78 | printf("[-] Server closed!"); 79 | break; 80 | } 81 | else if (recvlen > 0) 82 | { 83 | printf("[+] 收到消息:\n"); 84 | buf[recvlen] = '\0'; 85 | printf("%s\n", buf); 86 | } 87 | printf("---------------------------------------\n"); 88 | } 89 | 90 | return 0; 91 | } -------------------------------------------------------------------------------- /Programming_编程实验/Prog3_Chat实验/GroupChat_Client/client.h: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: Jed 3 | * @Description: client.h 4 | * @Date: 2019-03-23 5 | * @LastEditTime: 2019-03-23 6 | */ 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #pragma comment(lib, "ws2_32.lib") // 使用winsock 2.0 Llibrary 14 | 15 | const int BUFLEN = 2000; // 缓冲区大小 16 | 17 | unsigned __stdcall recvThread(void *p); -------------------------------------------------------------------------------- /Programming_编程实验/Prog3_Chat实验/GroupChat_Server/server.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: Jed 3 | * @Description: server.cpp 4 | * @Date: 2019-03-23 5 | * @LastEditTime: 2019-03-23 6 | */ 7 | #include "server.h" 8 | 9 | int main() 10 | { 11 | printf("[Group Chat Server]\n正在启动群聊服务器..."); 12 | 13 | struct sockaddr_in sin; // an Internet endpoint address 14 | struct sockaddr_in fsin; // the from address of a client 15 | u_short port = 50500; 16 | 17 | WSADATA wsadata; 18 | WSAStartup(MAKEWORD(2, 0), &wsadata); // 加载winsock library 19 | SOCKET msock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); // 监听套接字 20 | memset(&sin, 0, sizeof(sin)); // 从&sin开始的长度为sizeof(sin)的内存清0 21 | sin.sin_family = AF_INET; // 因特网地址簇(INET-Internet) 22 | sin.sin_addr.s_addr = INADDR_ANY; // 监听所有(接口的)IP地址 23 | sin.sin_port = htons(port); // 监听的端口号 24 | bind(msock, (struct sockaddr *)&sin, sizeof(sin)); // 绑定监听的IP地址和端口号 25 | listen(msock, 5); // 等待建立连接的队列长度为5 26 | 27 | time_t now = time(NULL); 28 | printf("成功。\n启动时间:%s\n", ctime(&now)); 29 | printf("=======================================\n"); 30 | 31 | while (!_kbhit()) 32 | { // 检测是否有按键 33 | int alen = sizeof(struct sockaddr); // 取到地址结构的长度 34 | SOCKET new_ssock = accept(msock, (struct sockaddr*)&fsin, &alen); // 如果有新的连接请求,返回连接套接字,否则,被阻塞。fsin包含客户端IP地址和端口号 35 | 36 | int ssocks_full = 1;// 是否达到最大并发数的标志位 37 | for (int i = 0; i < MAXSOCKS; i++) { 38 | if (threadinfo[i].handle == NULL) {// 找到数组中的一个可用位置 39 | threadinfo[i].thread_index = i; 40 | threadinfo[i].handle = (HANDLE)_beginthreadex(NULL, 0, &serveThread, (void*)&threadinfo[i], 0, NULL); 41 | threadinfo[i].ssock = new_ssock; 42 | threadinfo[i].fsin = fsin; 43 | ssocks_full = 0;// 未达到最大并发数,清除标志位 44 | CloseHandle(threadinfo[i].handle); // 关闭线程句柄,但并没有结束线程 45 | break; 46 | } 47 | } 48 | if (ssocks_full) {// 已经达到最大并发数,无法接纳更多连接 49 | const char* sorry_msg = "对不起,群聊人数已满,您暂时不能加入。"; 50 | send(new_ssock, sorry_msg, strlen(sorry_msg), 0); 51 | } 52 | } 53 | closesocket(msock); // 关闭监听套接字 54 | WSACleanup(); // 卸载winsock library 55 | 56 | return 0; 57 | } 58 | 59 | unsigned __stdcall serveThread(void* p) 60 | { 61 | ThreadInfo mythread = *(ThreadInfo*)p; 62 | char buf[BUFLEN + 1];// 线程缓冲区 63 | 64 | printf("发现新客户端加入群聊!\n"); 65 | strncpy(buf, "Enter!", BUFLEN); 66 | makeReplyMsg(buf, mythread.fsin); 67 | printf("%s", buf); 68 | sendToAll(buf); 69 | printf("---------------------------------------\n"); 70 | 71 | while (1) { 72 | int recvlen = recv(mythread.ssock, buf, BUFLEN, 0); // 接收信息 73 | if (recvlen == SOCKET_ERROR) 74 | { 75 | if (GetLastError() == 10054) { 76 | strncpy(buf, "Leave!", BUFLEN); 77 | makeReplyMsg(buf, mythread.fsin); 78 | printf("%s", buf); 79 | sendToAll(buf); 80 | } 81 | else{ 82 | printf("[-] Error: %ld.\n", GetLastError()); 83 | } 84 | printf("---------------------------------------\n"); 85 | break; 86 | } 87 | else if (recvlen == 0) 88 | { 89 | printf("[-] 客户端正常退出。\n"); 90 | printf("---------------------------------------\n"); 91 | break; 92 | } 93 | else { 94 | buf[recvlen] = '\0'; // 保证以空字符结尾 95 | makeReplyMsg(buf, mythread.fsin); 96 | printf("%s", buf); 97 | sendToAll(buf); 98 | printf("---------------------------------------\n"); 99 | } 100 | } 101 | threadinfo[mythread.thread_index].handle = NULL;// 从数组中移除该线程 102 | closesocket(mythread.ssock); 103 | return 0; 104 | } 105 | 106 | void sendToAll(const char* msg) 107 | { 108 | for (int i = 0; i < MAXSOCKS; i++) { 109 | if (threadinfo[i].handle != NULL) { 110 | send(threadinfo[i].ssock, msg, strlen(msg), 0); 111 | } 112 | } 113 | } 114 | 115 | void makeReplyMsg(char* msg, struct sockaddr_in fsin) { 116 | using namespace std; 117 | ostringstream os; 118 | os << "客户端:" << (int)fsin.sin_addr.S_un.S_un_b.s_b1 << '.' << (int)fsin.sin_addr.S_un.S_un_b.s_b2 119 | << '.' << (int)fsin.sin_addr.S_un.S_un_b.s_b3 << '.' << (int)fsin.sin_addr.S_un.S_un_b.s_b4 120 | << ':' << fsin.sin_port << endl; 121 | time_t now = time(NULL); 122 | os << "时间:" << ctime(&now) << flush; 123 | os << "消息:" << msg << endl; 124 | strncpy(msg, os.str().c_str(), BUFLEN); 125 | } -------------------------------------------------------------------------------- /Programming_编程实验/Prog3_Chat实验/GroupChat_Server/server.h: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: Jed 3 | * @Description: server.h 4 | * @Date: 2019-03-23 5 | * @LastEditTime: 2019-03-23 6 | */ 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "conio.h" 15 | #pragma comment(lib, "ws2_32.lib") //使用winsock 2.2 library 16 | 17 | const int MAXSOCKS = 5;// 最大并发连接数 18 | const size_t BUFLEN = 2000;// 缓冲区大小 19 | 20 | struct ThreadInfo { 21 | int thread_index;//线程被分配至的数组下标 22 | HANDLE handle;// 句柄,NULL代表尚未被分配 23 | SOCKET ssock;//和客户端连接的从套接字 24 | struct sockaddr_in fsin;//客户端地址 25 | 26 | ThreadInfo() :handle(NULL) {}// 构造函数 27 | }; 28 | ThreadInfo threadinfo[MAXSOCKS]; 29 | 30 | 31 | unsigned __stdcall serveThread(void* p);//服务一个客户端的线程 32 | void sendToAll(const char* msg);// 向所有客户端发送字符串 33 | void makeReplyMsg(char* msg, struct sockaddr_in fsin);// 在消息前面加上该客户端的IP地址和端口号以及服务器的当前时间 -------------------------------------------------------------------------------- /Programming_编程实验/Prog3_Chat实验/README.md: -------------------------------------------------------------------------------- 1 | # 多人聊天编程实验(Chat 实验) 2 | 3 | 2019.3.23 4 | 5 | 报告文档:[Chat实验.pdf](Chat实验.pdf) 6 | 7 | 8 | 9 | ## 任务一 10 | 11 | 编写多人聊天程序,要求客户端和服务器都采用多线程方式进行编程。每个客户端都采用TCP协议连接服务器并保持连接。服务器同时与所有客户端建立和保持连接。每个客户端输入的消息都会通过服务器转发给所有客户。 12 | 13 | 14 | 15 | ## 任务二 16 | 17 | 服务器程序转发某个客户端发来的消息时都在消息前面加上该客户端的IP地址和端口号以及服务器的当前时间。要求服务器程序把转发的消息也显示出来。 18 | 19 | 20 | 21 | ## 任务三 22 | 23 | 新客户刚连接时服务器端把“enter”消息(包含客户端IP地址和端口号)发送给所有客户端。 24 | 25 | 26 | 27 | ## 任务四 28 | 29 | 客户端输入exit时退出客户端程序(正常退出),或者客户端直接关闭窗口退出(异常退出),服务器都会把该客户leave的消息广播给所有客户。 30 | 31 | 32 | 33 | ## 参考资料 34 | 35 | [Getting Started with Winsock](https://docs.microsoft.com/en-us/windows/desktop/winsock/getting-started-with-winsock) 36 | 37 | [windows socket函数详解](https://www.cnblogs.com/hgwang/p/6074038.html) 38 | 39 | [对于CRITICAL_SECTION用法的介绍和理解](https://blog.csdn.net/shaoyiju/article/details/54882267) -------------------------------------------------------------------------------- /Programming_编程实验/Prog4_应用层实验/FtpDownloader/FtpDownloader.cpp: -------------------------------------------------------------------------------- 1 | #include "FtpDownloader.h" 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | printf("[FTP Downloader]\n"); 6 | 7 | if (argc != 6) { 8 | printf("[-] 无效参数\n" 9 | "Command: FtpDownloader.exe ServerIPAddress User Password FileName DestFile\n" 10 | "Example: FtpDownloader.exe 172.18.187.10 abc 123666 /ebook/ftp.pdf ftp1.pdf\n"); 11 | exit(-1); 12 | } 13 | 14 | const char *host = argv[1]; // server IP to connect 15 | u_short port = 21; // server port to connect 16 | struct sockaddr_in sin; // an Internet endpoint address 17 | char buf[BUFLEN + 1]; // buffer for one line of text 18 | SOCKET sock; // socket descriptor 19 | int cc; // recv character count 20 | 21 | WSADATA wsadata; 22 | WSAStartup(MAKEWORD(2, 0), &wsadata); //加载winsock library 23 | 24 | sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); //创建套接字,参数:因特网协议簇(family),流套接字,TCP协议 25 | memset(&sin, 0, sizeof(sin)); // 从&sin开始的长度为sizeof(sin)的内存清0 26 | sin.sin_family = AF_INET; // 因特网地址簇 27 | sin.sin_addr.s_addr = inet_addr(host); // 服务器IP地址(32位) 28 | sin.sin_port = htons(port); // 服务器端口号 29 | if (connect(sock, (struct sockaddr *)&sin, sizeof(sin)) == 0) { // 连接到服务器 30 | printf("连接到 ftp://%s 成功!\n", argv[1]); 31 | printf("---------------------------------------\n"); 32 | } 33 | else { 34 | printf("[-] 失败:%d\n", GetLastError()); 35 | printf("[-] 请检查输入的地址是否正确。按回车退出。\n"); 36 | exit(1); 37 | } 38 | 39 | /* 接收服务器欢迎信息 */ 40 | recvmsg(sock, buf); 41 | 42 | /* 登录账户 */ 43 | sprintf(buf, "USER %s\r\n", argv[2]); 44 | sendmsg(sock, buf); 45 | recvmsg(sock, buf); 46 | sprintf(buf, "PASS %s\r\n", argv[3]); 47 | sendmsg(sock, buf); 48 | recvmsg(sock, buf); 49 | 50 | /* 被动连接 */ 51 | sprintf(buf, "PASV\r\n"); 52 | sendmsg(sock, buf); 53 | recvmsg(sock, buf); 54 | SOCKET data_sock = dataConn(buf); 55 | 56 | /* 下载文件 */ 57 | sprintf(buf, "RETR %s\r\n", argv[4]); 58 | sendmsg(sock, buf); 59 | recvmsg(sock, buf); 60 | int filesize = saveFile(data_sock, argv[5]); 61 | 62 | /* 关闭连接 */ 63 | sprintf(buf, "QUIT\r\n"); 64 | sendmsg(sock, buf); 65 | recvmsg(sock, buf); 66 | 67 | closesocket(sock); // 关闭监听套接字 68 | WSACleanup(); // 卸载winsock library 69 | 70 | printf("---------------------------------------\n"); 71 | printf("下载结束:%s,共传输 %d 字节。\n", argv[5], filesize); 72 | 73 | return 0; 74 | } 75 | 76 | int sendmsg(SOCKET sock, char* msg) { 77 | printf(">>> "); 78 | printf(msg); //显示消息 79 | return send(sock, msg, strlen(msg) + 1, 0); // 发送消息 80 | } 81 | 82 | int recvmsg(SOCKET sock, char* buf) { 83 | int result = recv(sock, buf, BUFLEN, 0); 84 | buf[result] = '\0'; 85 | printf("[+] "); 86 | printf(buf); 87 | return result; 88 | } 89 | 90 | SOCKET dataConn(char* received_msg) { 91 | SOCKET result = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); 92 | int ip1, ip2, ip3, ip4, port1, port2; 93 | char data_ipaddr[17]; 94 | int data_port; 95 | char* pos = strchr(received_msg, '('); 96 | sscanf(pos + 1, "%d,%d,%d,%d,%d,%d", &ip1, &ip2, &ip3, &ip4, &port1, &port2); 97 | sprintf(data_ipaddr, "%d.%d.%d.%d", ip1, ip2, ip3, ip4); 98 | data_port = port1 * 256 + port2; 99 | 100 | struct sockaddr_in data_sin; // an Internet endpoint address 101 | memset(&data_sin, 0, sizeof(data_sin)); 102 | data_sin.sin_family = AF_INET; // 因特网地址簇 103 | data_sin.sin_addr.s_addr = inet_addr(data_ipaddr); // 服务器IP地址(32位) 104 | data_sin.sin_port = htons(data_port); // 服务器端口号 105 | 106 | connect(result, (struct sockaddr *)&data_sin, sizeof(data_sin)); 107 | return result; 108 | } 109 | 110 | int saveFile(SOCKET sock, char* fileName) { 111 | int size = 0; // 下载的文件大小 112 | char filebuf[FILEBUFLEN+1]; 113 | FILE* destfile = fopen(fileName, "wb"); 114 | int recvlen = 0; // 每次接收到的数据量 115 | while ((recvlen = recv(sock, filebuf, FILEBUFLEN, 0)) > 0) { // 循环接收数据,直到文件传输完毕 116 | size += recvlen; 117 | fwrite(filebuf, 1, FILEBUFLEN, destfile); 118 | } 119 | fclose(destfile); 120 | return size; // 返回下载的文件大小 121 | } -------------------------------------------------------------------------------- /Programming_编程实验/Prog4_应用层实验/FtpDownloader/FtpDownloader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog4_应用层实验/FtpDownloader/FtpDownloader.h -------------------------------------------------------------------------------- /Programming_编程实验/Prog4_应用层实验/README.md: -------------------------------------------------------------------------------- 1 | # 应用层实验 2 | 3 | 2019.4.14 4 | 5 | 报告文档:[应用层实验.pdf](应用层实验.pdf) 6 | 7 | 8 | 9 | ## 任务一~任务四 10 | 11 | Telnet 任务,已省略。 12 | 13 | 14 | 15 | ## 任务五 16 | 17 | 编写一个程序,用 FTP 协议下载指定文件。 18 | 19 | 20 | 21 | ## 任务六 22 | 23 | 编写 TCP Client。该客户端采用两个线程实现:一个输入和发送线程,一个接收线程。 24 | 25 | 26 | 27 | ## 实验总结 28 | 29 | 1. HTTP请求头之后有一个空行。HTTP请求报文分为请求行、头部行和消息正文,其中头部行与消息正文之间有一个空行(\r\n)。在本次实验发送的HTTP请求中,消息正文部分均为空,因此在使用Telnet发送HTTP请求时,需要在头部行后面紧跟两个空行,否则请求不完整,则不会得到相应。如果空行方式不当,则可能导致服务器返回400错误。 30 | 2. HTTP的Connection值一般是keep-alive的。使用Telnet发送带有“Connection: close”的请求,得到服务器响应后该连接立即被关闭;若发送带有“Connection: keep-alive”的请求,则服务器响应后连接没有关闭,可以紧接着直接发送下一条请求。如果不发送该字段,我发现效果与“Connection: keep-alive”是相同的。查阅资料得知,这是因为服务器默认的Connection设置为keep-alive的。 31 | 3. FTP协议的控制连接和数据连接。FTP协议的显著特征是具有控制连接和数据连接——前者负责发送命令,后者负责上传或下载数据;前者一般使用21号端口(也可以修改),而后者的端口号是不确定的,使用数据连接之前要先通过控制连接协商一个地址和端口号。使用Telnet的过程中发现,数据连接只能进行“一次服务”,如上传一个文件、下载一个文件或者显示一次文件目录,一旦完成了这些动作,数据连接立即被关闭。若想进行另一个操作,需要建立新的数据连接。新的数据连接和之前的数据连接的地址与端口号不一定相同,需要重新协商。 32 | 4. SMTP协议用到的字符全部是可显示ASCII码,也就是7位ASCII码。如果要传输特殊字符或者二进制文件,则需要使用特殊的编码方式将它们编码为7位ASCII码。用到的编码方式主要是Base64和quoted-printable这两种。经查阅资料得知,早期的电子邮件功能简单,仅仅用来传输可见的字符,因此只支持7位ASCII。不过随着互联网和计算机的发展,媒体种类越来越多,才采用MIME来支持非ASCII数据的传输。 33 | 5. 本次实验内容的五和六都通过上次实验(Chat实验)的程序改写而来。对于FtpDownloader程序,我使用了单线程(串行)的方法——采用这种方法是由FTP协议的特点决定的——仅有发送命令、接受回复这两个功能。对于TcpClient程序,采用了与聊天程序相似的多线程写法——主线程负责发送,子线程负责接收。在编写这两个程序的过程中需要特别注意的是,客户端向服务器发送的命令都必须以“\r\n”结尾。 34 | 6. 关于我使用的终端软件。平日里我使用SSH时最常用的终端软件是 MobaXterm,它具有许多功能,其中就包含Telnet的支持,因此我选用该软件作为完成本次实验的主要软件。除此之外,我还使用 cmd 中的 Telnet、SecureCRT、老师提供的TCPClient.exe、我自己编写的 TcpClient 一共5种不同的客户端来测试实验中的内容一到四,结果基本相同。 -------------------------------------------------------------------------------- /Programming_编程实验/Prog4_应用层实验/TcpClient/TcpClient.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog4_应用层实验/TcpClient/TcpClient.cpp -------------------------------------------------------------------------------- /Programming_编程实验/Prog4_应用层实验/TcpClient/TcpClient.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog4_应用层实验/TcpClient/TcpClient.h -------------------------------------------------------------------------------- /Programming_编程实验/Prog4_应用层实验/应用层实验.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog4_应用层实验/应用层实验.pdf -------------------------------------------------------------------------------- /Programming_编程实验/Prog5_文件传输实验/17341203_张怡昕_文件传输实验.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog5_文件传输实验/17341203_张怡昕_文件传输实验.doc -------------------------------------------------------------------------------- /Programming_编程实验/Prog5_文件传输实验/src/FileTransfer_Client.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog5_文件传输实验/src/FileTransfer_Client.cpp -------------------------------------------------------------------------------- /Programming_编程实验/Prog5_文件传输实验/src/FileTransfer_Server.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog5_文件传输实验/src/FileTransfer_Server.cpp -------------------------------------------------------------------------------- /Programming_编程实验/Prog5_文件传输实验/文件传输实验.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jed-Z/computer-networking-lab/646302f841cac6f5906118ba39ecf01d8d3a9bd5/Programming_编程实验/Prog5_文件传输实验/文件传输实验.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 计算机网络实验 2 | 3 | * 中山大学计算机学院 4 | * 计算机网络实验(Computer Networks Laboratory, DCS222);教师:张永民 5 | * 2019 春季学期(Spring 2019) 6 | 7 | 8 | 9 | 本仓库包含: 10 | 11 | 1. 计算机网络实验课程的全部内容,包括个人独立完成的编程实验和 4 人小组完成的配置实验。仓库中的代码和文档仅为我和我的小组完成的,无法保证正确性,仅供参考; 12 | 2. 小溪网上的理论练习题及参考答案,部分题目有解析。 13 | 14 | 15 | 16 | ## 编程实验 17 | 18 | | 序号 | 名称 | 简介 | 19 | | ---- | ------------------------------------------------------------ | ---------------------------------- | 20 | | 1 | [数据表示实验](Programming_编程实验/Prog1_数据表示实验) | 结构数据的保存和读取的方法 | 21 | | 2 | [Echo 实验](Programming_编程实验/Prog2_Echo实验) | 套接字(Socket)的基本使用方法 | 22 | | 3 | [多人聊天编程实验](Programming_编程实验/Prog3_Chat实验)(Chat 实验) | 套接字(Socket)的多线程编程方法 | 23 | | 4 | [应用层实验](Programming_编程实验/Prog4_应用层实验) | HTTP、FTP、SMTP、POP3 等协议的使用 | 24 | | 5 | [文件传输实验](Programming_编程实验/Prog5_文件传输实验) | 学习利用套接字传送文件 | 25 | 26 | 27 | 28 | ## 配置实验 29 | 30 | | 序号 | 名称 | 简介 | 31 | | ---- | ------------------------------------------------------------ | ------------------------------------------------------------ | 32 | | 1 | [二层交换机实验](Configuring_配置实验/Conf1_二层交换机实验) | 掌握二层交换机的基本配置和使用方法 | 33 | | 2 | [VLAN 实验](Configuring_配置实验/Conf2_VLAN实验) | 掌握交换机的 VLAN 配置方法 | 34 | | 3 | [静态路由实验](Configuring_配置实验/Conf3_静态路由实验) | 掌握静态路由的配置和使用方法 | 35 | | 4 | [VLAN 间路由实验](Configuring_配置实验/Conf4_VLAN间路由实验) | 掌握 VLAN 间静态路由的配置和使用方法,熟悉三层交换机的配置方法 | 36 | | 5 | [RIP 配置实验](Configuring_配置实验/Conf5_RIP配置实验) | 学习 RIPv2 的配置方法 | 37 | | 6 | [OSPF 配置实验](Configuring_配置实验/Conf6_OSPF配置实验) | 掌握 OSPF 协议单区域配置方法 | 38 | | 7 | [综合组网实验](Configuring_配置实验/Conf7_综合组网实验) | 学习通过三层交换技术和 OSPF 协议把实验网连入校园网 | 39 | 40 | 41 | 42 | ## 理论练习题 43 | 44 | 另附计算机网络[理论练习题及其参考答案](计网理论练习题)(小溪网)。 45 | 46 | | 序号 | 内容描述 | 网页版 | 题量 | 47 | | ---------------- | ------------------------------ | ---- | ---- | 48 | | 1 | 计网基本概念、时延、物理层 | [作业1](https://jed-z.github.io/computer-networking-lab/计网理论练习题/作业1.html) | 49 | 49 | | 2 | 数据链路层 | [作业2](https://jed-z.github.io/computer-networking-lab/计网理论练习题/作业2.html) | 24 | 50 | | 3 | 以太网、透明网桥、生成树、VLAN | [作业3](https://jed-z.github.io/computer-networking-lab/计网理论练习题/作业3.html) | 26 | 51 | | 4 | IP 协议和 IP 地址 | [作业4](https://jed-z.github.io/computer-networking-lab/计网理论练习题/作业4.html) | 40 | 52 | | 5 | 路由协议:RIP、OSPF | [作业5](https://jed-z.github.io/computer-networking-lab/计网理论练习题/作业5.html) | 19 | 53 | | 6 | 传输层 | [作业6](https://jed-z.github.io/computer-networking-lab/计网理论练习题/作业6.html) | 39 | 54 | 55 | -------------------------------------------------------------------------------- /计网理论练习题/作业2.html: -------------------------------------------------------------------------------- 1 | 6 | 小溪网--中山大学17计算机网络--做作业: 作业2 7 | 8 | 9 | 10 | 11 |
12 |
13 |
14 |
15 | 16 |
17 |
18 | 19 |
20 |
    

中山大学17计算机网络

 


作业名称:作业2

作业描述:数据链路层 21 | (问答题只选改,未批改的不计入总分)

开始时间:2019/3/14 0:30:00

截止时间:2019/3/24 23:00:00

作业状态:已截止

未完成题数:0   总题数:24


第A节
123456789101112131415
222223322333322
222

3022333322
161718192021222324
444333333
444333



  总得分:50   总分:53   百分制分数:94


22 |

A.回答下面问题(默认为每题2分)

23 |
24 |
25 |

1. 数据链路层的功能是负责在中传输数据帧。


    得分: 2分

[0]  [0]  求讲解[1]  问老师

27 |

2. 以下哪些是数据链路层的功能?
28 | A.framing
29 | B.error detection
30 | C.error control
31 | D.routing
32 | E.medium access control
33 | F.encryption


    得分: 2分

[0]  [0]  求讲解[1]  问老师

35 |

3. 以下为收到的带有二维奇偶校验码(偶校验)的数据:
36 | 10001
37 | 11000
38 | 11110
39 | 01110
40 | 10001
41 | 请问哪个位置的比特出错了?
42 | A.row 1 col 2
43 | B.row 5 col 4
44 | C.row 4 col 3
45 | D.row 4 col 2


    得分: 2分

[0]  [0]  求讲解[4]  问老师

47 |

4. 二维奇偶校验码是否可以检出所有的两位错误?
48 | A.可以
49 | B.不可以
50 | 请证明你的结论。
51 |


未批改

[5]  [14]  求讲解[73]  问老师

62 |

5. 根据下面给出的二维奇偶校验码证明二维奇偶校验码不能纠正两位错误。
63 | 10100
64 | 11101
65 | 10010
66 | 11101
67 | 00110
68 |


未批改

[3]  [5]  求讲解[16]  问老师

79 |

6. 数据(十六进制)8AE4B578E0E6EE03的检验和是什么?
80 |
(3 points)


    得分: 3分

[1]  [0]  求讲解[51]  问老师

85 |

7. 数据为110101101100011011(D),除数(G)为10011, CRC校验码(R)是什么?(二进制)
86 |
(3 points)


×    得分: 0分

[5]  [2]  求讲解[35]  问老师

107 |

8. 如果当前RTT=1ms,采用选择性重传(selective repeat)滑动窗口协议,超时时间应设置为略大于ms;如果收到NAK就重置所有的超时定时器,那超时时间应设置为略大于ms。


    得分: 2分

[4]  [8]  求讲解[63]  问老师

114 |

9. 如果滑动窗口协议的发送窗口大小为42,当前有20帧发送出去了但未收到确认, 问有新的确认帧到达前还可以发送多少帧?
115 |


    得分: 2分

[1]  [2]  求讲解[0]  问老师

117 |

10. 把停等协议用于一个带宽为20Mbps、长度为3000公里、传播速度为200000公里/秒的点到点链路,如果最长帧为5000字节,带宽的最大利用率(最大吞吐量/带宽)是百分之多少?
118 |
(3 points)


    得分: 3分

[0]  [4]  求讲解[17]  问老师

125 |

11. 如果上题改为滑动窗口协议,发送窗口大小为8,带宽的最大利用率(最大吞吐量/带宽)又是百分之多少?
126 |
(3 points)


    得分: 3分

[3]  [11]  求讲解[54]  问老师

133 |

12. 如果使用回退N滑动窗口协议,发送窗口大小为4,可以循环使用的序号为0~7,RTT大于4帧的发送时间。如果发送方发送了从序号3开始的10个数据帧,除了第2帧(序号为4)和第5帧(序号为7)丢失,包含重传帧在内的其它帧均正确到达接收方,问接收方依次收到这些帧(含重传帧)的序号(序号之间用一个空格隔开)。
134 |
(3 points)


    得分: 3分

[5]  [4]  求讲解[20]  问老师

136 |

13. 如果上题改为选择性重传,并且接收窗口大小等于发送窗口大小,并且只有第2帧丢失,问接收方依次收到这些帧(含重传帧)的序号(序号之间用一个空格隔开)。
137 |
(3 points)


    得分: 3分

[1]  [2]  求讲解[17]  问老师

139 |

14. PPP协议用以下哪个协议获取IP地址?
140 | A.LCP
141 | B.IPCP
142 | C.IPXCP
143 | D.CHAP


    得分: 2分

[1]  [4]  求讲解[6]  问老师

148 |

15. PPP协议用以下哪个协议确定是否需要身份认证?
149 | A.LCP
150 | B.IPCP
151 | C.IPXCP
152 | D.CHAP


    得分: 2分

[1]  [4]  求讲解[8]  问老师

157 |

16. 停等协议至少需要多少个序号?为什么?
158 |
(4 points)


    得分: 4分

[3]  [2]  求讲解[13]  问老师

163 |

17. 选择性重传协议的RWS大于SWS是否有意义?为什么?
164 |
(4 points)


    得分: 4分

[2]  [2]  求讲解[5]  问老师

171 |

18. 选择性重传协议需要的最少序号个数与SWS和RWS有什么关系?为什么?
172 |
(4 points)


    得分: 4分

[3]  [2]  求讲解[15]  问老师

175 |

19. 选择性重传协议可能会收到落在接收窗口之外的数据帧。这句话是否正确?请解释。
176 |
(3 points)


    得分: 3分

[3]  [3]  求讲解[6]  问老师

179 |

20. 回退N协议可能会收到落在发送窗口之外的确认帧。这句话是否正确?请解释。
180 |
(3 points)


    得分: 3分

[1]  [0]  求讲解[8]  问老师

183 |

21. 选择性重传协议丢失了NAK并非致命错误。这句话是否正确?请解释。
184 |
(3 points)


    得分: 3分

[0]  [1]  求讲解[12]  问老师

188 |

22. 如果选择性重传协议不采用NAK,设计一种可行方法完成只重传丢失帧的任务。
189 |
(3 points)


未批改

[1]  [2]  求讲解[31]  问老师

191 |

23. 为什么ARQ协议的超时时间不应设置得太长?
192 |
(3 points)


未批改

[0]  [0]  求讲解[5]  问老师

195 |

24. 滑动窗口协议的确认帧的确认号表示什么含义,它这样表示的好处是什么?
196 |
(3 points)


未批改

[2]  [1]  求讲解[1]  问老师

    

198 |
199 |

200 | 201 |
202 |
203 | 204 | --------------------------------------------------------------------------------