# 临时修改网卡地址 网关 Mac地址

1、临时性地修改MAC并设置静态IP(重启networking后设置复原) 首先，必须关闭网卡设备，否则会报告系统忙，无法更改：

&#x20;`sudo ifconfig dummy1 down`&#x20;

然后，修改MAC地址，填写修改后的MAC

&#x20;`sudo ifconfig dummy1 hw ether XX:XX:XX:XX:XX:XX`&#x20;

重新启用网卡

&#x20;`sudo ifconfig dummy1 up`

设置主机静态IP地址、子网掩码的操作：&#x20;

`sudo ifconfig dummy1 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx`&#x20;

添加默认网关的操作：&#x20;

`sudo route add default gw xxx.xxx.xxx.xxx`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blog.jsmsr.com/blog/lin-shi-xiu-gai-wang-ka-di-zhi-wang-guan-mac-di-zhi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
