أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
go to /etc/sysconfig/network-scripts
vi ifcfg-eth0
and edit the below
DEVICE=eth0
BOOTPROTO=static
HWADDR=xxxxxxxxx (THis is the NIC MAC address)
IPADDR= Your IP
NETMASK= netmask
ONBOOT=yes
save and exit this file.
then open ifcfg-eth1 file :
vi ifcdfg-eth1
DEVICE=eth1
BOOTPROTO=dhcp
HWADDR=xxxxxxxxx (THis is the other NIC MAC address)
ONBOOT=yes
restart network services and now it should work fine even at PC restart.
Thanks,
Configure in ifcfg-eth0 and ifcfg-eth1 file from /etc/sysconfig/network-scripts
For dhcp - put bootproto as dhcp
static - put bootproto as none/static
Specify IPADDR=x.x.x.x
GATEWAY=x.x.x.x
DNS1=x.x.x.x
Hi,
Make sure before you making any changes to configuration file you have the backup of it and have root login credentails...if you move to this directory point /etc/sysconfig/network-scripts/ there you will find two files
1- ifcfg-eth0
2- ifcfg-eth1
cd /etc/sysconfig/network-scripts/
vi ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=xxxxxxxxx
IPADDR= Your Public IP
NETMASK= specify netmask
ONBOOT=yes
save and exit this file.
then open ifcfg-eth1 file :
vi ifcdfg-eth1
DEVICE=eth1
BOOTPROTO=dhcp
HWADDR=xxxxxxxxx
ONBOOT=yes
make sure you restart network services.
services network restart
check that IP information has been updated. use
ifconfig or ethtool eth0 are very usefull commands.
you have to configure eth0 by editing the following: /etc/sysconfig/network-scripts/ifcfg-eth0
and put the static iP address as:
DEVICE=eth0
HWADDR=
TYPE=Ethernet
ONBOOT=yes
IPV6INIT=
IPADDR=
NETMASK=
BROADCAST=
NETWORK=
GATEWAY=
DNS1=
DNS2=
and the same as assine a local IP address for eth1 to get ip from DHCP
add this:
BOOTPROTO=dhcp
I've done this once before on an openBSD..
I had to simply configure the eth0 with a static ip address, using ifconfig.. then start the dhcpd on eth1.. and edit the routing table to tell the new network where is its gateway.. you'll probably need to look into nameservers if you are using extra services.
gl