LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: axlrose

贴一个在archlinux下的rc.conf里设置绑定多个IP的方法

[复制链接]
发表于 2009-9-1 22:13:21 | 显示全部楼层
学习了。。。做个标记。
回复 支持 反对

使用道具 举报

发表于 2009-9-2 12:02:37 | 显示全部楼层
我改成
  1. eth0="dhcp"
  2. eth00="eth0:0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
  3. INTERFACES=(eth0 eth00)
  4. #gateway="default gw 192.168.0.1"
  5. ROUTES=(!gateway)
复制代码
重启后:
  1. # ifconfig
  2. eth0      Link encap:Ethernet  HWaddr 00:16:D3:FC:89:1D
  3.           inet addr:192.168.1.102  Bcast:192.168.1.255  Mask:255.255.255.0
  4.           inet6 addr: fe80::216:d3ff:fefc:891d/64 Scope:Link
  5.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  6.           RX packets:710 errors:0 dropped:0 overruns:0 frame:0
  7.           TX packets:824 errors:0 dropped:0 overruns:0 carrier:0
  8.           collisions:0 txqueuelen:1000
  9.           RX bytes:583934 (570.2 Kb)  TX bytes:143123 (139.7 Kb)
  10.           Interrupt:27 Base address:0x8000
  11. eth0:0    Link encap:Ethernet  HWaddr 00:16:D3:FC:89:1D
  12.           inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
  13.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  14.           Interrupt:27 Base address:0x8000
  15. lo        Link encap:Local Loopback
  16.           inet addr:127.0.0.1  Mask:255.0.0.0
  17.           inet6 addr: ::1/128 Scope:Host
  18.           UP LOOPBACK RUNNING  MTU:16436  Metric:1
  19.           RX packets:72 errors:0 dropped:0 overruns:0 frame:0
  20.           TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
  21.           collisions:0 txqueuelen:0
  22.           RX bytes:3720 (3.6 Kb)  TX bytes:3720 (3.6 Kb)
复制代码
dhcp 这段能用,现在还上网,不知道另一个网段是否能用,一台机器好像没法测试。我最多只能
  1. # ping 192.168.0.2
  2. PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.
  3. 64 bytes from 192.168.0.2: icmp_seq=1 ttl=64 time=0.087 ms
  4. 64 bytes from 192.168.0.2: icmp_seq=2 ttl=64 time=0.067 ms
  5. 64 bytes from 192.168.0.2: icmp_seq=3 ttl=64 time=0.070 ms
  6. 64 bytes from 192.168.0.2: icmp_seq=4 ttl=64 time=0.068 ms
  7. 64 bytes from 192.168.0.2: icmp_seq=5 ttl=64 time=0.071 ms
  8. 64 bytes from 192.168.0.2: icmp_seq=6 ttl=64 time=0.069 ms
  9. ^C
  10. --- 192.168.0.2 ping statistics ---
  11. 6 packets transmitted, 6 received, 0% packet loss, time 4997ms
  12. rtt min/avg/max/mdev = 0.067/0.072/0.087/0.006 ms
复制代码
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表