Using a PC as a proxy to access external networks from a server
1. Start a proxy on the PC, such as nginx
Download nginx: http://nginx.org/en/download.html
Modify the configuration file in the conf directory:
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 888;
server_name localhost;
resolver 114.114.114.114;
location / {
if ($scheme = 'http') {
proxy_pass http://$host$request_uri;
}
if ($scheme = 'https') {
proxy_pass https://$host$request_uri;
}
proxy_set_header Host $host;
proxy_buffers 256 4k;
proxy_max_temp_file_size 0k;
}
}
}
Start nginx by double-clicking.
Note: If using HTTPS, the Windows version cannot be used. A Linux version must be compiled manually. ./configure --prefix=/opt/nginx --with-http_ssl_module --add-module=./modules/ngx_http_proxy_connect_module --with-openssl=…/…/openssl/openssl-1.1.1 The HTTPS function currently works with curl https://blog.csdn.net/ but fails with curl https://baidu.com.
2. Start SSH
ssh -R localhost:xxx1:localhost:xxx2 username@serverIP
Parameters are: server port:PC host:PC port
After conencting, set the proxy:
export {http,https}_proxy='localhost:xxx1'
Note: This setting may still prompt "Unsupported proxy configured: localhost://7890" for apt commands. Add the following to apt.conf: Acquire::http::Proxy "http://127.0.0.1:7890"; Acquire::https::Proxy "http://127.0.0.1:7890";
The overall topology is now established.
Changing BIOS boot parameters via IPMI
First, turn off the power: ipmitool -H BMC_IP -U user -P password chassis power soft
Check if it's off: ipmitool -I lanplus -H BMC_IP -U user -P password power status
In one terminal, connect to the console: ipmitool -I lanplus -H BMC_IP -U user -P password sol activate
In another terminal, power on: ipmitool -I lanplus -H BMC_IP -U user -P password power on
Then press F4 (depending on the prompt) to enter BIOS.