Lý do thiết lập bộ định tuyến ADSL làm bộ chuyển mạch là để tăng cường tín hiệu WiFi tại bàn làm việc của tôi. Tuy nhiên, đôi khi tôi cần chuyển về giao diện WiFi iiscwlan
khi di chuyển máy tính xách tay của mình
Đặt IP động
Đầu tiên, bộ điều hợp WiFi máy tính xách tay của tôi đã kết nối với wololo
WAP của modem ADSL + bộ định tuyến
Ngắt kết nối khỏi WAP wololo
Cho phép giao diện
#!python
'''Script to set Dynamic IP to the WiFi adaptor of laptop
so that it auto configure to have an IP address that
belongs to the same network address as that of the iiscwlan WAP.'''
import subprocess
dhcpCommand = '''netsh interface ip set address "WiFi" dhcp'''
command = dhcpCommand.split[]
subprocess.run[command]
0 bật DHCP#!python
'''Script to set Dynamic IP to the WiFi adaptor of laptop
so that it auto configure to have an IP address that
belongs to the same network address as that of the iiscwlan WAP.'''
import subprocess
dhcpCommand = '''netsh interface ip set address "WiFi" dhcp'''
command = dhcpCommand.split[]
subprocess.run[command]
1Kết nối với WAP iiscwlan
. Máy chủ DHCP tại
#!python
'''Script to set Dynamic IP to the WiFi adaptor of laptop
so that it auto configure to have an IP address that
belongs to the same network address as that of the iiscwlan WAP.'''
import subprocess
dhcpCommand = '''netsh interface ip set address "WiFi" dhcp'''
command = dhcpCommand.split[]
subprocess.run[command]
3 và #!python
'''Script to set Dynamic IP to the WiFi adaptor of laptop
so that it auto configure to have an IP address that
belongs to the same network address as that of the iiscwlan WAP.'''
import subprocess
dhcpCommand = '''netsh interface ip set address "WiFi" dhcp'''
command = dhcpCommand.split[]
subprocess.run[command]
4 tự động gán Địa chỉ IP #!python
'''Script to set Dynamic IP to the WiFi adaptor of laptop
so that it auto configure to have an IP address that
belongs to the same network address as that of the iiscwlan WAP.'''
import subprocess
dhcpCommand = '''netsh interface ip set address "WiFi" dhcp'''
command = dhcpCommand.split[]
subprocess.run[command]
0 cho giao diện WiFi có chỉ số #!python
'''Script to set Dynamic IP to the WiFi adaptor of laptop
so that it auto configure to have an IP address that
belongs to the same network address as that of the iiscwlan WAP.'''
import subprocess
dhcpCommand = '''netsh interface ip set address "WiFi" dhcp'''
command = dhcpCommand.split[]
subprocess.run[command]
1 và bí danh #!python
'''Script to set Dynamic IP to the WiFi adaptor of laptop
so that it auto configure to have an IP address that
belongs to the same network address as that of the iiscwlan WAP.'''
import subprocess
dhcpCommand = '''netsh interface ip set address "WiFi" dhcp'''
command = dhcpCommand.split[]
subprocess.run[command]
0Lưu ý các máy chủ DNS được đặt thành
#!python
'''Script to set Dynamic IP to the WiFi adaptor of laptop
so that it auto configure to have an IP address that
belongs to the same network address as that of the iiscwlan WAP.'''
import subprocess
dhcpCommand = '''netsh interface ip set address "WiFi" dhcp'''
command = dhcpCommand.split[]
subprocess.run[command]
3 và #!python
'''Script to set Dynamic IP to the WiFi adaptor of laptop
so that it auto configure to have an IP address that
belongs to the same network address as that of the iiscwlan WAP.'''
import subprocess
dhcpCommand = '''netsh interface ip set address "WiFi" dhcp'''
command = dhcpCommand.split[]
subprocess.run[command]
4. Tuy nhiên, đôi khi những thứ này không được đặt và cần được tải xuống từ các máy chủ DHCP#!python
'''Script to set Dynamic IP to the WiFi adaptor of laptop
so that it auto configure to have an IP address that
belongs to the same network address as that of the iiscwlan WAP.'''
import subprocess
dhcpCommand = '''netsh interface ip set address "WiFi" dhcp'''
command = dhcpCommand.split[]
subprocess.run[command]
5Bằng cách này, IP được đặt động. Đó là nó
Đặt IP tĩnh
Chạy powershell với tư cách Quản trị viên và kiểm tra chỉ mục giao diện cho giao diện WiFi. Giao diện có chỉ số
#!python
'''Script to set Dynamic IP to the WiFi adaptor of laptop
so that it auto configure to have an IP address that
belongs to the same network address as that of the iiscwlan WAP.'''
import subprocess
dhcpCommand = '''netsh interface ip set address "WiFi" dhcp'''
command = dhcpCommand.split[]
subprocess.run[command]
1 với bí danh #!python
'''Script to set Dynamic IP to the WiFi adaptor of laptop
so that it auto configure to have an IP address that
belongs to the same network address as that of the iiscwlan WAP.'''
import subprocess
dhcpCommand = '''netsh interface ip set address "WiFi" dhcp'''
command = dhcpCommand.split[]
subprocess.run[command]
0. Nó được kết nối với WAP iiscwlan
bằng địa chỉ IP #!python
'''Script to set Dynamic IP to the WiFi adaptor of laptop
so that it auto configure to have an IP address that
belongs to the same network address as that of the iiscwlan WAP.'''
import subprocess
dhcpCommand = '''netsh interface ip set address "WiFi" dhcp'''
command = dhcpCommand.split[]
subprocess.run[command]
0iiscwlan
0
Ngắt kết nối khỏi WAP iiscwlan
Để kết nối với WAP wololo
, chúng tôi cần biết địa chỉ mạng của nó. Chúng tôi biết nó thuộc về địa chỉ mạng iiscwlan
3 với các địa chỉ IP khả dụng bắt đầu từ iiscwlan
4 vì địa chỉ bộ định tuyến là
#!python
'''Script to set Dynamic IP to the WiFi adaptor of laptop
so that it auto configure to have an IP address that
belongs to the same network address as that of the iiscwlan WAP.'''
import subprocess
dhcpCommand = '''netsh interface ip set address "WiFi" dhcp'''
command = dhcpCommand.split[]
subprocess.run[command]
4. Hãy để chúng tôi đặt địa chỉ IP của giao diện #!python
'''Script to set Dynamic IP to the WiFi adaptor of laptop
so that it auto configure to have an IP address that
belongs to the same network address as that of the iiscwlan WAP.'''
import subprocess
dhcpCommand = '''netsh interface ip set address "WiFi" dhcp'''
command = dhcpCommand.split[]
subprocess.run[command]
0 thuộc phạm vi này. Hãy để chúng tôi dành iiscwlan
7 cho giao diện ethernet của máy tính để bàniiscwlan
8
Điều này bật lên một iiscwlan
9 nói rằng Cổng mặc định đã tồn tại. Hãy để chúng tôi xóa tùy chọn Cổng mặc định và thử lại
wololo
0
Một lần nữa bật lên một iiscwlan
9
Để giải quyết vấn đề này, trước tiên hãy kết nối với WAP
wololo
, sau đó thực hiện lệnh mà không có cổng mặc định vì WAPiiscwlan
trước đó đã có cùng một cổng mặc định4#!python '''Script to set Dynamic IP to the WiFi adaptor of laptop so that it auto configure to have an IP address that belongs to the same network address as that of the iiscwlan WAP.''' import subprocess dhcpCommand = '''netsh interface ip set address "WiFi" dhcp''' command = dhcpCommand.split[] subprocess.run[command]
Chúng ta cần đặt máy chủ DNS
wololo
5
Bằng cách này, IP được đặt tĩnh. Đó là nó
Đặt địa chỉ IP động bằng cách sử dụng tập lệnh Python
Nhập các lệnh này rất hữu ích. Tuy nhiên, do yêu cầu về trình tự chính xác cũng như yêu cầu về độ chính xác, tốt hơn là nên có một tập lệnh riêng cho cài đặt địa chỉ IP tĩnh hoặc động
Nhờ khả năng viết kịch bản của Python để xử lý việc thực thi lệnh hệ thống, chúng tôi sử dụng mô-đun wololo
6 cho tác vụ