2024年3月26日发(作者:)

linux route&nic config(Linux路由和网卡配置)

Linux card lost Linux service network restart Linux

configuration IP

Just after the restart Linux, but not connected to the network,

ifconfig, eth0 card no

[root@localhost ifconfig ~]#

Lo Link encap:Local Loopback

INET addr:127.0.0.1 Mask:255.0.0.0

Inet6 addr::: 1/128 Scope:Host

UP LOOPBACK RUNNING MTU:16436 Metric:1

RX packets:12 errors:0 dropped:0 overruns:0 frame:0

TX packets:12 errors:0 dropped:0 overruns:0 carrier:0

Collisions:0 txqueuelen:0

RX bytes:864 (864 b) TX bytes:864 (864 b)

We supposed to do?

Immediate effect:

Ifconfig eth0 192.168.0.1 netmask 255.255.255.0

Start effective:

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

join

IPADDR=192.168.0.1

NETMASK=255.255.255.0

And then restart the #:service network restart service network

-----------------------------------------------------------

-----------------------------------------------------------

--------

Configuring IP address under Linux

Immediate effect:

Ifconfig eth0 192.168.1.102 netmask 255.255.255.0

Start effective:

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

join

IPADDR=192.168.1.102

NETMASK=255.255.255.0