TBLinux:How to change the ip address

From TBwiki
(Difference between revisions)
Jump to: navigation, search
(Switch from DHCP to static)
(Updated TOC)
 
(7 intermediate revisions by 2 users not shown)
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 manually change the management IP address of TMG800/TMG3200/TMG7800 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.
+
On '''TMG800''' and '''TMG3200''' units you can have up to four internal interfaces:
 +
*pre-2011:
 +
**TMG800 -> Management Interface: eth0, Internal Interface: eth1
 +
**TMG3200-> Management Interface: eth0, Internal Interface: eth1
  
 +
*2011 and after:
 +
**TMG800 -> Management Interface: mgmt0, Internal Interface: vlan3, 1+1 interface#1: vlan710, 1+1 interface#2: vlan711
 +
**TMG3200-> Management Interface: mgmt0, Internal Interface:  int0, 1+1 interface#1: vlan710, 1+1 interface#2: vlan711
  
== Switch from DHCP to static ==
+
'''NOTE 1:''' Only the eth0/mgmt0 network interface should be changed, int0/vlan3/eth1 should stay at 172.31.1.2 since it is directly connected to the Tmedia base board and 1+1 vlans are configured with the Host role (see [[Tmedia_1%2B1|Tmedia 1+1]]).
  
'''Modify the eth0 configuration'''
+
'''NOTE 2:''' The network 172.31.1.x (netmask 255.255.255.0) cannot be used for the management IP.
    vi /etc/sysconfig/network-scripts/ifcfg-eth0
+
  
''NOTE: you need to remove the line DHCP_HOSTNAME''
+
 
 +
On '''TMG7800-CTRL''' servers, you have three internal interfaces:
 +
*pre-2011:
 +
**TMG7800-> Management Interface: eth0, Internal Interface#1: eth1, Internal Interface#2: eth2
 +
 
 +
*2011 and after:
 +
**TMG7800-> Management Interface: mgmt0, Internal Interface#1: eth0, Internal Interface#2: eth1
 +
 
 +
'''NOTE 1:''' Only the eth0/mgmt0 network interface should be changed. eth1/eth0 will use the default address for primary (172.16.0.1) or secondary (172.16.0.2). eth2/eth1 will use the default address for primary (172.18.0.1) or secondary (172.18.0.2). (see [[Tmedia_1%2B1|Tmedia 1+1]]).
 +
 
 +
'''NOTE 2:''' The networks 172.16.x.x and 172.18.x.x (netmask 255.255.0.0) cannot be used for the management Interface IP.
 +
 
 +
<br>
 +
 
 +
== Switch from DHCP to static<br>  ==
 +
 
 +
===Modify the mgmt0 (or eth0) configuration===
 +
 
 +
    vi /etc/sysconfig/network-scripts/ifcfg-mgmt0
 +
 
 +
''NOTE 1: you need to remove the line DHCP_HOSTNAME''
 +
 
 +
''NOTE 2: int0/vlan3/eth1 interface must remain '''172.31.1.2'''''  
  
 
:Example:
 
:Example:
     DEVICE=eth0
+
 
 +
     DEVICE=mgmt0
 
     BOOTPROTO=static
 
     BOOTPROTO=static
 
     IPADDR=192.168.1.10
 
     IPADDR=192.168.1.10
Line 21: Line 49:
 
     ONBOOT=yes
 
     ONBOOT=yes
  
'''Add the default gateway address in the network configuration file'''
+
===Add 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
 
     GATEWAY=192.168.1.1
 
     GATEWAY=192.168.1.1
  
 +
===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
 
    nameserver 192.168.1.5
 
  
:Restart the network interfaces:
+
  &nbsp;; generated by /sbin/dhclient-script
    /etc/init.d/network restart
+
    nameserver 4.2.2.2
  
'''In toolpack.ini, set the variable "TBDB_SERVER_PRI":'''
+
===Restart the network interfaces===
  
'''Located'''
+
     /etc/init.d/network restart
: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.'''
+
== Switch from static to DHCP  ==
:Example:
+
    TBDB_SERVER_PRI = 172.31.1.2
+
  
'''To localhost, for release v2.3.14 and later.'''
+
===Modify the mgmt0 (or eth0) configuration===
:Example:
+
    TBDB_SERVER_PRI = localhost
+
  
== Switch from static to DHCP ==
+
    vi /etc/sysconfig/network-scripts/ifcfg-mgmt0
  
'''Modify the eth0 configuration'''
+
''NOTE 1: you need to remove the IPADDR and NETMASK lines''  
    vi /etc/sysconfig/network-scripts/ifcfg-eth0
+
  
''NOTE: you need to remove the IPADDR and NETMASK lines''
+
''NOTE 2: int0/vlan3/eth1 interface must remain static at '''172.31.1.2'''''  
  
 
:Example:
 
:Example:
     DEVICE=eth0
+
 
 +
     DEVICE=mgmt0
 
     BOOTPROTO=dhcp
 
     BOOTPROTO=dhcp
 
     IPV6ADDR=
 
     IPV6ADDR=
Line 81: Line 99:
 
     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":'''
 
 
'''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
 

Latest revision as of 08:59, 27 October 2016

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

On TMG800 and TMG3200 units you can have up to four internal interfaces:

  • pre-2011:
    • TMG800 -> Management Interface: eth0, Internal Interface: eth1
    • TMG3200-> Management Interface: eth0, Internal Interface: eth1
  • 2011 and after:
    • TMG800 -> Management Interface: mgmt0, Internal Interface: vlan3, 1+1 interface#1: vlan710, 1+1 interface#2: vlan711
    • TMG3200-> Management Interface: mgmt0, Internal Interface: int0, 1+1 interface#1: vlan710, 1+1 interface#2: vlan711

NOTE 1: Only the eth0/mgmt0 network interface should be changed, int0/vlan3/eth1 should stay at 172.31.1.2 since it is directly connected to the Tmedia base board and 1+1 vlans are configured with the Host role (see Tmedia 1+1).

NOTE 2: The network 172.31.1.x (netmask 255.255.255.0) cannot be used for the management IP.


On TMG7800-CTRL servers, you have three internal interfaces:

  • pre-2011:
    • TMG7800-> Management Interface: eth0, Internal Interface#1: eth1, Internal Interface#2: eth2
  • 2011 and after:
    • TMG7800-> Management Interface: mgmt0, Internal Interface#1: eth0, Internal Interface#2: eth1

NOTE 1: Only the eth0/mgmt0 network interface should be changed. eth1/eth0 will use the default address for primary (172.16.0.1) or secondary (172.16.0.2). eth2/eth1 will use the default address for primary (172.18.0.1) or secondary (172.18.0.2). (see Tmedia 1+1).

NOTE 2: The networks 172.16.x.x and 172.18.x.x (netmask 255.255.0.0) cannot be used for the management Interface IP.


Contents

Switch from DHCP to static

Modify the mgmt0 (or eth0) configuration

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

NOTE 1: you need to remove the line DHCP_HOSTNAME

NOTE 2: int0/vlan3/eth1 interface must remain 172.31.1.2

Example:
   DEVICE=mgmt0
   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

Switch from static to DHCP

Modify the mgmt0 (or eth0) configuration

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

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

NOTE 2: int0/vlan3/eth1 interface must remain static at 172.31.1.2

Example:
   DEVICE=mgmt0
   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
Personal tools