from:cnscn2008.cublog.cn
带着笔记本,最麻烦的是在家和在公司因为网段不同,所以每次必须切换IP地址才能上网。今天给网卡添加第二个IP地址,也就是生成一个ifcfg-eth0:1来解决这个问题:
1)/etc/sysconfig/netwok-scripts/ifcfg-eth0 (172.16.1.68)
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
IPADDR=172.16.1.68
NETMASK=255.255.254.0
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
BROADCAST=172.16.1.255
NETWORK=172.16.0.0
HWADDR=00:17:08:2d:93:66
GATEWAY=172.16.1.254
2)1)/etc/sysconfig/netwok-scripts/ifcfg-eth0:1 (192.168.0.103)
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.0.103
NETMASK=255.255.255.0
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
BROADCAST=192.168.0.255
NETWORK=192.168.0.0
HWADDR=00:17:08:2d:93:66
GATEWAY=192.168.0.1
3)/etc/resolv.conf
; generated by /sbin/dhclient-script
search localdomain
nameserver 202.xx.xx.xx
nameserver 172.16.1.254
nameserver 192.168.0.1
以后在家在公司都不用切换IP地址了,直接就能用.
( 而且今天很郁闷的是192 一直拼成了172, 找了半天才看出来,,呵呵 )
阅读(577) | 评论(0) | 转发(0) |