TBLinux:How to change the ip address

From TBwiki
(Difference between revisions)
Jump to: navigation, search
(Modified to mgmt0)
(Removed mgmt0)
Line 1: Line 1:
This article will explain how to change the IP address of TMG800/TMG3200 of the Linux host.
+
This article will explain how to change the IP address of TMG800/TMG3200 of the Linux host.  
  
NOTE: Only the eth0 network interface should be change, eth1 should stays at 172.31.1.2 because it is directly connected to the Tmedia base board.
+
NOTE: Only the eth0 network interface should be change, eth1 should stays at 172.31.1.2 because it is directly connected to the Tmedia base board.<br>
  
 +
== Switch from DHCP to static<br>  ==
  
== Switch from DHCP to static  ==
+
'''Modify the eth0 configuration'''
  
====== Note: With units shipped since August 2011, the eth0 configuration name has changed to mgmt0. Use eth0 instead of mgmt0 for older configuration. You can verify if the configuration exists with "ls -a /etc/sysconfig/network-scripts/ifcfg-mgmt0". Use [http://docs.telcobridges.com/mediawiki/index.php/TMG:Change_Management_IP_Address tbchangeip ]for newer configuration instead of the manual procedure described below.<br> ======
+
     vi /etc/sysconfig/network-scripts/ifcfg-eth0
 
+
'''Modify the mgmt0 configuration'''
+
 
+
     vi /etc/sysconfig/network-scripts/ifcfg-mgmt0
+
  
 
''NOTE 1: you need to remove the line DHCP_HOSTNAME''  
 
''NOTE 1: you need to remove the line DHCP_HOSTNAME''  
Line 18: Line 15:
 
:Example:
 
:Example:
  
     DEVICE=mgmt0
+
     DEVICE=eth0
 
     BOOTPROTO=static
 
     BOOTPROTO=static
 
     IPADDR=192.168.1.10
 
     IPADDR=192.168.1.10
Line 86: Line 83:
 
     TBDB_SERVER_PRI = localhost
 
     TBDB_SERVER_PRI = localhost
  
== Switch from static to DHCP ==
+
== Switch from static to DHCP ==
 +
 
 +
'''Modify the eth0 configuration'''
  
'''Modify the eth0 configuration'''
 
 
     vi /etc/sysconfig/network-scripts/ifcfg-eth0
 
     vi /etc/sysconfig/network-scripts/ifcfg-eth0
  
''NOTE 1: you need to remove the IPADDR and NETMASK lines''
+
''NOTE 1: you need to remove the IPADDR and NETMASK lines''  
  
''NOTE 2: eth1 interface must remain static at '''172.31.1.2'''''
+
''NOTE 2: eth1 interface must remain static at '''172.31.1.2'''''  
  
 
:Example:
 
:Example:
 +
 
     DEVICE=eth0
 
     DEVICE=eth0
 
     BOOTPROTO=dhcp
 
     BOOTPROTO=dhcp
Line 104: Line 103:
 
     DHCP_HOSTNAME=TB005376
 
     DHCP_HOSTNAME=TB005376
  
'''Remove the default gateway address in the network configuration file'''
+
'''Remove the default gateway address in the network configuration file'''  
 +
 
 
     vi /etc/sysconfig/network
 
     vi /etc/sysconfig/network
  
 
:Example:
 
:Example:
 +
 
     HOSTNAME=TB005376
 
     HOSTNAME=TB005376
 
     NETWORKING=yes
 
     NETWORKING=yes
  
'''Modify the dhcp client configuration.'''
+
'''Modify the dhcp client configuration.'''  
  
''NOTE:If you don't have a nameserver, remove it from the file, if you do set it to a valid one(DNS).''
+
''NOTE:If you don't have a nameserver, remove it from the file, if you do set it to a valid one(DNS).''  
  
 
     vi /etc/resolv.conf
 
     vi /etc/resolv.conf
  
 
:Example of a DNS configuration file without DNS server:
 
:Example of a DNS configuration file without DNS server:
    ; generated by /sbin/dhclient-script
 
  
 +
  &nbsp;; generated by /sbin/dhclient-script
 +
 +
<br>
  
 
:Example of a DNS configuration file containing a DNS server (in theory the dns server should configure itself properly):
 
:Example of a DNS configuration file containing a DNS server (in theory the dns server should configure itself properly):
    ; generated by /sbin/dhclient-script
+
 
 +
  &nbsp;; generated by /sbin/dhclient-script
 
     nameserver 192.168.1.5
 
     nameserver 192.168.1.5
  
'''In toolpack.ini, set the variable "TBDB_SERVER_PRI":'''
+
'''In toolpack.ini, set the variable "TBDB_SERVER_PRI":'''
 +
 
 +
'''Located'''  
  
'''Located'''
 
 
:For release v2.2:
 
:For release v2.2:
 +
 
     vi /lib/tb/toolpack/setup/2.2/toolpack.ini
 
     vi /lib/tb/toolpack/setup/2.2/toolpack.ini
 +
 
:For release v2.3:
 
:For release v2.3:
 +
 
     vi /lib/tb/toolpack/setup/12358/2.3/toolpack.ini
 
     vi /lib/tb/toolpack/setup/12358/2.3/toolpack.ini
 +
 
:For release v2.4:
 
:For release v2.4:
 +
 
     vi /lib/tb/toolpack/setup/12358/2.4/toolpack.ini
 
     vi /lib/tb/toolpack/setup/12358/2.4/toolpack.ini
  
'''To eth1 IP address, for release v2.3.13 and earlier.'''
+
'''To eth1 IP address, for release v2.3.13 and earlier.'''  
 +
 
 
:Example:
 
:Example:
 +
 
     TBDB_SERVER_PRI = 172.31.1.2
 
     TBDB_SERVER_PRI = 172.31.1.2
  
'''To localhost, for release v2.3.14 and later.'''
+
'''To localhost, for release v2.3.14 and later.'''  
 +
 
 
:Example:
 
:Example:
 +
 
     TBDB_SERVER_PRI = localhost
 
     TBDB_SERVER_PRI = localhost

Revision as of 10:47, 12 September 2011

This article will explain how to change the IP address of TMG800/TMG3200 of the Linux host.

NOTE: Only the eth0 network interface should be change, eth1 should stays at 172.31.1.2 because it is directly connected to the Tmedia base board.

Switch from DHCP to static

Modify the eth0 configuration

   vi /etc/sysconfig/network-scripts/ifcfg-eth0

NOTE 1: you need to remove the line DHCP_HOSTNAME

NOTE 2: eth1 interface must remain 172.31.1.2

Example:
   DEVICE=eth0
   BOOTPROTO=static
   IPADDR=192.168.1.10
   NETMASK=255.255.255.0
   IPV6ADDR=
   IPV6PREFIX=
   IPV6_AUTOCONF=yes
   ONBOOT=yes

Add the default gateway address in the network configuration file

   vi /etc/sysconfig/network
Example:
   HOSTNAME=TB005376
   NETWORKING=yes
   GATEWAY=192.168.1.1


Modify the DHCP client configuration.

NOTE:If you don't have a nameserver, remove it from the file, if you do set it to a valid one(DNS).

   vi /etc/resolv.conf
Example of a DNS configuration file without DNS server:
   ; generated by /sbin/dhclient-script


Example of a DNS configuration file containing a DNS server (in theory the dns server should configure itself properly):
   ; generated by /sbin/dhclient-script
   nameserver 4.2.2.2
Restart the network interfaces:
   /etc/init.d/network restart

In toolpack.ini, set the variable "TBDB_SERVER_PRI":

Located

For release v2.2:
   vi /lib/tb/toolpack/setup/2.2/toolpack.ini
For release v2.3:
   vi /lib/tb/toolpack/setup/12358/2.3/toolpack.ini
For release v2.4:
   vi /lib/tb/toolpack/setup/12358/2.4/toolpack.ini

To eth1 IP address, for release v2.3.13 and earlier.

Example:
   TBDB_SERVER_PRI = 172.31.1.2

To localhost, for release v2.3.14 and later.

Example:
   TBDB_SERVER_PRI = localhost

Switch from static to DHCP

Modify the eth0 configuration

   vi /etc/sysconfig/network-scripts/ifcfg-eth0

NOTE 1: you need to remove the IPADDR and NETMASK lines

NOTE 2: eth1 interface must remain static at 172.31.1.2

Example:
   DEVICE=eth0
   BOOTPROTO=dhcp
   IPV6ADDR=
   IPV6PREFIX=
   IPV6_AUTOCONF=yes
   ONBOOT=yes
   DHCP_HOSTNAME=TB005376

Remove the default gateway address in the network configuration file

   vi /etc/sysconfig/network
Example:
   HOSTNAME=TB005376
   NETWORKING=yes

Modify the dhcp client configuration.

NOTE:If you don't have a nameserver, remove it from the file, if you do set it to a valid one(DNS).

   vi /etc/resolv.conf
Example of a DNS configuration file without DNS server:
   ; generated by /sbin/dhclient-script


Example of a DNS configuration file containing a DNS server (in theory the dns server should configure itself properly):
   ; generated by /sbin/dhclient-script
   nameserver 192.168.1.5

In toolpack.ini, set the variable "TBDB_SERVER_PRI":

Located

For release v2.2:
   vi /lib/tb/toolpack/setup/2.2/toolpack.ini
For release v2.3:
   vi /lib/tb/toolpack/setup/12358/2.3/toolpack.ini
For release v2.4:
   vi /lib/tb/toolpack/setup/12358/2.4/toolpack.ini

To eth1 IP address, for release v2.3.13 and earlier.

Example:
   TBDB_SERVER_PRI = 172.31.1.2

To localhost, for release v2.3.14 and later.

Example:
   TBDB_SERVER_PRI = localhost
Personal tools