LINUX VPS

webmin Unable to determine IP address of primary interface

eth0 is the most common ethernet device name, but it is not the only one, other device names are possible. Do this:

route

On line which says default in the first column, the last column will be the device name you most probably need. Afterwards, run this:

ifconfig <devicename>

Look for the value after inet addr, usually on line 2 of output. This is the IP address you’re looking for.

 
[root@iZ94csyo4u1Z ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
120.24.12.0 * 255.255.252.0 U 0 0 0 eth1
10.44.88.0 * 255.255.248.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
172.16.0.0 10.44.95.247 255.240.0.0 UG 0 0 0 eth0
100.64.0.0 10.44.95.247 255.192.0.0 UG 0 0 0 eth0
10.0.0.0 10.44.95.247 255.0.0.0 UG 0 0 0 eth0
default 120.24.15.247 0.0.0.0 UG 0 0 0 eth1
[root@iZ94csyo4u1Z ~]# ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:16:3E:00:23:A7
inet addr:120.24.13.62 Bcast:120.24.15.255 Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:142464 errors:0 dropped:0 overruns:0 frame:0
TX packets:34017 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:206762072 (197.1 MiB) TX bytes:2925228 (2.7 MiB)

 

 

Leave a Reply

学习的梦想

锤炼的彩色