chginet 方法

用途

重新配置因特网实例。

语法

奇吉内 [ -d] [ -"属性=..."]

描述

chginet 方法重新配置因特网实例,且还可更改 HostName 变量以及任何已定义的静态路由。 chginet 方法调用 hostname 命令来更改主机名。 chginet 方法还调用 route 命令来更改任何静态路由。 chdev 命令调用方法。

注: chginet 方法是编程工具,不应从命令行输入。

标志

描述
-a "属性= ..." 指定因特网实例的定制属性。 以下都是有效的属性:
hostname
指定主机的名称。
gateway
指定缺省网关。
route
指定路由。 route 属性的 Value 变量的格式为: route = type, [args ,] , destination gateway, [metric]。

type 参数的值可以为 nethost

delroute
指定要删除的路由。 delroute 属性的 Value 变量的格式为: delroute = type, [args,] , destination gateway, [metric]。

type 参数的值可以为 nethost

rout6
指定 IPv6 路由。 rout6 属性的 Value 变量的格式为: rout6 = type, [args,] , destinationgateway, [metric] type 参数的值可以是 nethost
delrout6
指定要删除的 IPv6 路由。 delrout6 属性的 Value 变量的格式为: delrout6 = type, [args,] , destinationgateway, [metric] type 参数的值可以是 nethost
-d 指定只在配置数据库中进行更改。 随着下一次 IPL,更改才生效。

示例

  1. 要更改因特网实例并指定路由,以下列格式输入方法:

    chginet -a"route=192.9.200.0,bcroom"

    此示例指定了新路由。 正在将新路由设置为网络192.9.200.0bcroom网关。

  2. 此示例指定了新路由。 正在将新路由设置为主机192.9.200.5以及hopcount 2,接口en0bcroom 网关。

    chginet -a"route=host,-hopcount,2,-if,en0,192.9.200.5,bcroom"
  3. 此示例删除在先前示例中添加的路由。

    chginet -a"delroute=host,-hopcount,2,-if,en0,192.9.200.5,bcroom"
  4. 此示例指定了新的 IPv6 路由。 正在将新路由设置为主机2001::1以及hopcount 2,接口en0fe80::20b4:40ff:fe00:f016网关。
    chginet -a"rout6=host,-hopcount,2,-if,en0,2001::1,fe80::20b4:40ff:fe00:f016"
  5. 此示例删除在先前示例中添加的 IPv6 路由。
    chginet -a"delrout6=host,-hopcount,2,-if,en0,2001::1,fe80::20b4:40ff:fe00:f016"