Zealot's Blog

Coding life...
数据加载中……

2009年9月24日

在Debian中为网卡添加路由

在debian中添加一条路由,

修改/etc/network/interfaces

############################################################
auto lo
iface lo inet loopback

iface eth0 inet static

        address 192.168.12.12
        netmask 255.255.255.0
        network 192.168.12.0
        broadcast 192.168.12.255
        gateway 192.168.12.3

        # dns-* options are implemented by the resolvconf package, if installed
        # DNS Server还需要更改另外一个文件 /etc/resolv.conf

        dns-nameservers 192.168.15.2     

    up route add -net 192.168.15.0 netmask 255.255.255.0 gw 192.168.12.34  metric 1
    down route del -net 192.168.15.0 netmask 255.255.255.0 gw 192.168.12.34  metric 1
############################################################

posted @ 2009-09-24 14:49 Zealot 阅读(168) 评论(0) 编辑