Two Network Interface Config in LinuxNetwork Administration

Begin Learning Cyber Security for FREE Now!

FREE REGISTRATION
Already a Member Login Here

Home Forums Network Administration Two Network Interface Config in Linux

Tagged: ,

This topic contains 2 replies, has 3 voices, and was last updated by  cybermo 1 year, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #95264

    DS Thakuri
    Participant

    Hi all,
    I am trying to configure networking in Linux VM with two Network Adapters (eth0 and eth1). I wanted eth0’s IP to be assigned statically for the local network and eth1 to be assigned by the DHCP for the internet connection.

    So, the machine should be able to ping another VM in the same local network via eth0 and should access the internet via eth1 without alternating either of the network adapter connection.

    Can anyone please guide me to configure the interfaces.conf (/etc/network/interface.conf) and NetworkManager config file or anything that needs to to make it work, please? Thank you.
    The below is my config and Local network is connected to VMNet 2 and another adapter is on NAT.

    # interfaces(5) file used by ifup(8) and ifdown(8)
    auto lo
    iface lo inet loopback

    # Primary network interface
    #iface eth0 inet dhcp
    allow eth0
    iface eth0 inet static
    address 10.0.0.2
    netmask 255.255.255.0
    gateway 10.0.0.2

    allow-hotplug eth1
    iface eth1 inet dhcp
    #

    #95309

    Chin_Diesel
    Moderator

    Take that gateway off your static route, if its just to communicate solely with that 10.0.0 network. Use your gateway on the DHCP-issued adapter, and make sure when you type “route” that you see the eth1 adapter and gateway is set for your default GW.

    #116800

    cybermo
    Participant

    ,😀

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Our Revolution

We believe Cyber Security training should be free, for everyone, FOREVER. Everyone, everywhere, deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is a free community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

Cybrary On The Go

Get the Cybrary app for Android for online and offline viewing of our lessons.

Get it on Google Play
 

Support Cybrary

Donate Here to Get This Month's Donor Badge

 
Skip to toolbar

We recommend always using caution when following any link

Are you sure you want to continue?

Continue
Cancel