This discussion is archived
8 Replies Latest reply: May 19, 2013 8:31 PM by HuaMin Chen RSS

Way to have 2 IPs

HuaMin Chen Pro
Currently Being Moderated
Hi,
Within my Vbox running OL5.9 inside, I have

Adapter 1 Attached to Internal network
Adapter 2 Attached to Bridged adapter

I expect to have one internal IP like 192.168.168.20 to eth0 and one Dynamic IP allocated by my ISP to eth1. How should I further adjust the relevant setting/config of Eth0 & eth1 within Rhat?
  • 1. Re: Way to have 2 IPs
    Dude! Guru
    Currently Being Moderated
    The internal network adapter is rather unusual. I suggest to check the documentation to see if this is really what you want:
    http://www.virtualbox.org/manual/ch06.html#network_internal
  • 2. Re: Way to have 2 IPs
    HuaMin Chen Pro
    Currently Being Moderated
    Thanks. I've already selected Internal network for Adapter 1 then how to adjust eth0 inside Rhat?
  • 3. Re: Way to have 2 IPs
    Dude! Guru
    Currently Being Moderated
    Sorry, I don't understand your answer in response to my reply.

    Also, what do you need to know? How to configure TCP/IP under Red Hat?
  • 4. Re: Way to have 2 IPs
    HuaMin Chen Pro
    Currently Being Moderated
    You know I have 2 adapters right, to the Vbox. How to configure eth0 and eth1 due to these 2 adapters?

    How to ensure eth0 is with internal IP like

    192.168.168.20?

    Edited by: HuaMin Chen on May 15, 2013 3:38 PM
  • 5. Re: Way to have 2 IPs
    Dude! Guru
    Currently Being Moderated
    Your abilities to communicate between host/vm, vm/host, vm/vm and Internet or Intranet depend on both, choosing the appropriate VirtualBox Ethernet adapter and configuring the TCP/IP stack of your VM guest OS accordingly.

    How to ensure that an adapter uses a specific TCP/IP address? You need to use static TCP/IP addressing as opposed to DHCP. However, if you choose the wrong VirtualBox Ethernet adapter your network communication will not work regardless of how you configure the TCP/IP settings.

    I still don't understand your actual question. The device eth0 usually corresponds to Network Adapter 1 of VirtualBox, and eth1 to Adapter no. 2. You can compare the device MAC (hardware) addresses in the VM network adapter settings with the output of your ifconfig command on the VM guest OS to make sure you are configuring the devices accordingly. Is this what you are asking?

    You are not asking how to configure eth0 with a static IP address and eth1 with DHCP, are you?
  • 6. Re: Way to have 2 IPs
    HuaMin Chen Pro
    Currently Being Moderated
    Yes, I expect to have a static IP on eth0 and DHCP on eth1.

    Here is what I get by "ifconfig".
    eth0 Link encap:Ethernet HWaddr 08:00:27:4D:74:68
    inet6 addr: fe80::a00:27ff:fe4d:7468/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:1 errors:0 dropped:0 overruns:0 frame:0
    TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:243 (243.0 b) TX bytes:5243 (5.1 KiB)

    eth1 Link encap:Ethernet HWaddr 08:00:27:C4:03:D0
    inet addr:?.?.240.157 Bcast:?.?.255.255 Mask:255.255.240.0
    inet6 addr: fe80::a00:27ff:fec4:3d0/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:239 errors:0 dropped:0 overruns:0 frame:0
    TX packets:116 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:22028 (21.5 KiB) TX bytes:14414 (14.0 KiB)

    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:3011 errors:0 dropped:0 overruns:0 frame:0
    TX packets:3011 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:4681992 (4.4 MiB) TX bytes:4681992 (4.4 MiB)
  • 7. Re: Way to have 2 IPs
    Dude! Guru
    Currently Being Moderated
    Google is your best friend for such type of questions. The following comes up here as the first link when searching for "how to configure a static ip address in rhel":

    http://www.cyberciti.biz/faq/linux-configure-a-static-ip-address-tutorial/
    http://www.cyberciti.biz/faq/rhel-centos-fedoracore-linux-network-card-configuration/

    There are many other sides and reference links providing such info. As well as the official product documentation. It shows you, including pictures, how to configure a static TCP/IP address under various Linux distributions and interfaces.

    Does this answer your question?

    P.S. A minimum effort and research including Google should be expected before posting a question. Consulting the documentation is also recommended by the forum etiquette.
  • 8. Re: Way to have 2 IPs
    HuaMin Chen Pro
    Currently Being Moderated
    Good day Dude,
    Thanks.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points