Openstack physical machine deployment network card configuration

2019.9.22
NIC specific instruction learning

[bjtu@computer1 network-scripts]$ cat ifcfg-Redmi 
HWADDR=3C:91:80:7F:E4:EF   //硬件地址
ESSID=Redmi
MODE=Managed
KEY_MGMT=WPA-PSK
MAC_ADDRESS_RANDOMIZATION=default
TYPE=Wireless      //网卡类型:无线网卡
PROXY_METHOD=none		//代理方式;关闭状态
BROWSER_ONLY=no			//只是浏览器:关闭状态
BOOTPROTO=none		//网卡的引导协议无,有时或者改为DHCP(自动分配ip地址)
DEFROUTE=yes 			//默认路由:是。是对IP数据包中的目的地址找不到存在的其他路由时,路由器所选择的路由。
IPV4_FAILURE_FATAL=no		//是否开启IPV4致命错误检测:否
IPV6INIT=yes		//IPV6是否自动初始化:是【不会有任何影响,现在还没用到IPV6】
IPV6_AUTOCONF=yes		//IPV6是否自动配置:是【不会有任何影响,同上】
IPV6_DEFROUTE=yes		//IPV6是否可以为默认路由:是【同上】
IPV6_FAILURE_FATAL=no		//IPV6是否开启致命错误检测
IPV6_ADDR_GEN_MODE=stable-privacy	//IPV6地址生成模型:stable-privacy【这只是一种生成IPV6的策略】
NAME=Redmi	//物理网卡设备名称
UUID=ad8b3347-817f-453c-9dd9-aa68bf6f0684 //通用唯一识别码,每一个网卡都会有,不能重复,否则两台Linux只有一台网卡可用
ONBOOT=yes   //是否开机启动
IPADDR=192.168.43.162
PREFIX=24
GATEWAY=192.168.43.1
DNS1=192.168.43.1

Route forwarding

2019.9.29

Test host 2 wired network card to surf the Internet through host 1 wireless network card

Network topology
Insert picture description here
The 10.0.0.1 route deleted by host 1 (make the default route of host 1 192.168.43.1)
#route del default gw 10.0.0.1

The routing and forwarding function added by host 1
#vi /etc/sysctl.conf
net.ipv4.ip_forward = 1

Host 1 is set to route
#/sbin/iptables -t nat -A POSTROUTING -o wlp3s0 -j ​​MASQUERADE

Host 2 adds default route 10.0.0.31
#route add default gw 10.0.0.31

Host 2 adds domain name resolution
#vi /etc/resolv.conf
nameserver 192.168.43.1

//Install wireshark for packet capture analysis
#yum install wireshark -y
#yum install wireshark-gnome
packet capture command:
#tcpdump -i any -s0 -w /home/bjtu/test.pcap

At this time, you can obtain dual network cards for shared Internet access
**

Perform the above host 1 operations on both hosts to complete the openstack network configuration

**

Guess you like

Origin blog.csdn.net/weixin_44747789/article/details/101161887