将 Red Hat 语法转换为 Ubuntu 语法以用于网络

将 Red Hat 语法转换为 Ubuntu 语法以用于网络

我有以下 Red 语言 - 如何将其转换为 Ubuntu 语法?相关文件是什么?

/etc/sysconfig/network

NETWORKING=yes
HOSTNAME=onyx.boisestate.edu
GATEWAY=132.178.208.1

/etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=none
BROADCAST=132.178.223.255
IPADDR=132.178.208.159
NETMASK=255.255.240.0
NETWORK=132.178.208.0
ONBOOT=yes
USERCTL=no
PEERDNS=no
GATEWAY=132.178.208.1
TYPE=Ethernet

/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=none
BROADCAST=192.168.0.255
IPADDR=192.168.0.1
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes
USERCTL=no
PEERDNS=no
TYPE=Ethernet

答案1

主机名在文件/etc/sysconfig/network中设置/etc/hosts

127.0.0.1  onyx.boisestate.edu  onyx

您可以将其添加为:

132.178.208.159 onyx.boisestate.edu  onyx

以太网接口/etc/sysconfig/network-scripts/ifcfg-ethX在文件中设置/etc/network/interfaces如下:

auto eth0
    iface eth0 inet static
    address 192.168.0.1
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.0.255

auto eth1
    iface eth1 inet static
    address 132.178.223.159
    netmask 255.255.240.0
    network 132.178.208.0
    broadcast 132.178.223.255
    gateway 132.178.208.1

希望这可以帮助!

相关内容