Linux环境下如何配置IP地址、MAC地址
1、配置IP地址
进入配置IP地址路径,进行修改即可
cd /etc/network
vim interface 加入以下内容:
iface eth0 inet static
address 192.168.10.191
netmask 255.255.255.0
gateway 192.168.10.254
broadcast 192.168.10.255之后,执行以下命令:
/etc/init.d/networking restart最后ifconfig查看修改情况。
2、配置MAC地址
ifconfig eth0 down
ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
ifconfig eth0 up
最后ifconfig查看修改情况。
3、获取远程MAC地址的方法
方法一:
arp -a 192.168.10.200(获取的物理地址就是所谓的MAC地址)
方法二:
nbtstat -a 192.168.10.200(此方法不仅可以获取MAC地址,还可以获取到远程电脑的名称和所属工作组)
4、关闭防火墙
首先完成下一步,查看情况:
iptables -L // 查看系统中所有链的默认target
其次,进行关闭防火墙操作:
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F // 关闭防火墙