网络常用配置:
配置ip:
ifconfig eth0 172.28.0.2/16 或者 ifconfig eth0 172.28.0.2 netmask
255.255.0.0
配置多个ip:
ip address add 172.28.0.3/16 brd + dev eth0
配置虚拟端口ip:
ifconfig eth0:1 172.28.0.5 netmask
255.255.0.0
或者 ip addr add 172.28.0.5/16 broadcast + dev eth0 label
eth0:wan
配置子接口ip:
!~~~~~~~
配置mac:
ifconfig eth0 hw ether FD:FG:FE:00:34:89
查看路由:route
添加默认网关:route add default gw 128.6.0.1
删除路由:route del gw 128.6.0.1
或者使用ip route命令
ifconfig ifup ifdown
加载bond模块:xxxx
创建bond:echo +bond >/sys/class/net/bonding_masters
修改bond模式:echo 1 > /sys/class/net/bond/bonding/mode
将网口添加到bond中:ifenslave bond eth0 eth1【bond要先up】
将bond中删除网口:ifenslave -d bond eth0
bond中网口主备倒换:ifenslave -c bond eth1
linux桥:
brctl show
brctl addbr br_base1;
brctl addif br_base1 eth0
ovs桥:
ovs-vsctl show
ovs-vsctl addbr br_base1
ovs-vsctl addport br_base1 eth0
ovs-vsctl listbr
ovs-vsctl listports br_base1
添加虚拟设备veth pair:
ip link add xxxxxxxxxxxxxx
查看本地的arp表项?
arp
vconfig配置vlan?
http://fp-moon.iteye.com/blog/1564478
参考地址:
http://blog.163.com/chjian_guo/blog/static/493085920098810510393/