下面是Linux网络配置的一些技巧。
# ifconfig eth0 down # ifconfig eth1 down # modprobe bonding # ifconfig bond0 192.168.0.1 # ifenslave eth0 # ifenslave eth1
# ifconfig eth0:0 192.168.0.2 # ifconfig eth0:1 192.168.0.3 ......
# ifconfig eth0 0.0.0.0 # ifconfig eth1 0.0.0.0
# brctl addbr mybridge # brctl addif mybridge eth0 # brctl addif mybridge eth1
# ifconfig mybridge up
# ifconfig mybridge 192.168.0.1 netmask 255.255.255.0 up
# echo 1 > /proc/sys/net/ipv4/ip_forward # 打开 # echo 0 > /proc/sys/net/ipv4/ip_forward # 关闭
# echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all # 打开 # echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all # 关闭
# netstat -ln
# lsof -i
# ifconfig eth0 down # ifconfig eth0 hw ether 12:34:56:78:90:ab # ifconfig eth0 up
# ifconfig eth0 promisc
Linux网络配置基础
下面是Linux网络配置的一些技巧。
# ifconfig eth0:0 192.168.0.2 # ifconfig eth0:1 192.168.0.3 ......依次类推,Linux最多可支持255个IP别名。Categories
Feeds
Tags
Copyright © 2012 Zhigang Wang. Some right reserved.
The views expressed on this web site are my own and do not necessarily reflect the views of Oracle.