How to edit /config/network.cfg for 2 NICs?


ericave

Recommended Posts

I have probelm setting 2 NICs using WebUI, so I have to edit /config/network.cfg using NotePad++.

Now, my network.cfg is:

#Static IP
USE_DHCP=no
IPADDR=192.168.2.38
NETMASK=255.255.255.0
GATEWAY=192.168.2.2
DNS_SERVER1=192.168.2.2
DNS_SERVER2=
DNS_SERVER3=

 

It works fine for onboard GBe NIC. Now I am adding a 2.5GBe NIC and I want to set another static IP for 2.5GBe NIC. What modifications are needed?

 

Link to comment
29 minutes ago, trurl said:

Why?

 

It's for my my specific network configuration needs. I can explain the details, but it may be tedious. So, please forgive me not explaining why. In essential, the 2 NICs are connecting to different subnets, so they needs different IP address.

For the time being, I need to set 2 distinct static IP address for 2 NICs on one PC by editing network.cfg, not WebUI.

Edited by ericave
Link to comment

I have made it.

This is my network.cfg:

# Generated settings:
IFNAME[0]="eth0"
DHCP_KEEPRESOLV="yes"
DNS_SERVER1="192.168.2.2"
DHCP6_KEEPRESOLV="yes"
PROTOCOL[0]="ipv4"
USE_DHCP[0]="no"
IPADDR[0]="192.168.2.70"
NETMASK[0]="255.255.255.0"
GATEWAY[0]="192.168.2.2"
USE_DHCP6[0]="no"
IFNAME[1]="eth1"
PROTOCOL[1]="ipv4"
USE_DHCP[1]="no"
IPADDR[1]="111.111.111.112"
NETMASK[1]="255.255.255.0"
GATEWAY[1]="111.111.111.111"
SYSNICS="2"

 

Some of my findings while trying:

1. unRAID will generate a "network-rules.cfg" to set sequence of eth0, eth1, ... It can be altered either through WebUI or modifying the cfg file.

2. After applying change to Network Settings, connection will be lost. And a reboot is required. Shutdown unRAID first, check network.cfg is correct and then restart unRAID.

 

 

 

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.