can change ip of eth0?


Recommended Posts

I have installed centos 5.2 x86 as guest on windows 7 as host.

I have selected all adpaters and pointed to NAT, HIF and internal network and th e ip is a sfolloes.

[root:localhost:~]# ifconfig -a

eth0 Link encap:Ethernet HWaddr 08:00:27:94:21:7E

inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0

inet6 addr: fe80::a00:27ff:fe94:217e/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

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

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

collisions:0 txqueuelen:1000

RX bytes:4756714 (4.5 MiB) TX bytes:223475 (218.2 KiB)

Base address:0xc010 Memory:f0000000-f0020000

eth1 Link encap:Ethernet HWaddr 08:00:27:C8:35:B0

BROADCAST MULTICAST MTU:1500 Metric:1

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

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

collisions:0 txqueuelen:1000

RX bytes:0 (0.0 b) TX bytes:12104 (11.8 KiB)

Interrupt:9 Base address:0xc260

eth2 Link encap:Ethernet HWaddr 08:00:27:CF:18:FC

BROADCAST MULTICAST MTU:1500 Metric:1

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

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

collisions:0 txqueuelen:1000

RX bytes:0 (0.0 b) TX bytes:17663 (17.2 KiB)

Base address:0xc240 Memory:f0820000-f0840000

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:6908 errors:0 dropped:0 overruns:0 frame:0

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

collisions:0 txqueuelen:0

RX bytes:9786923 (9.3 MiB) TX bytes:9786923 (9.3 MiB)

sit0 Link encap:IPv6-in-IPv4

NOARP MTU:1480 Metric:1

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

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

collisions:0 txqueuelen:0

RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

I want to change eth0' ip 10.0.2.15 to 192.168.0.x. So I changed this ip as foloows.

ifconfig eth0 down

ifconfig eth0 192.168.0.11 netmask 255.255.255.0 up

ifconfig eth0 up

/etc/sysconfig/network

NETWORKING=yes

HOSTNAME=localhost.localdomain

GATEWAY=192.168.10.1

/etc/sysconfig/network-scripts/ifcfg-ethx

DEVICE=eth0

BOOTPROTO=static

BROADCAST=192.168.0.255

IPADDR=192.168.0.11

NETMASK=255.255.255.0

NETWORK=192.168.0.0

ONBOOT=yes

But I cannot connect to web.

Please let me know how to change eth0' IP to 192.168.0.x.

Link to comment
Share on other sites

Why would you want that first IP to change to 192.168.0.x? The Virtualbox guest will receive 10.0.2.15 as an IP for the NAT function. If you change eth0 to another value, you won't be able to connect anymore.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.