<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Linux%2FNetworking</id>
	<title>Linux/Networking - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Linux%2FNetworking"/>
	<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Linux/Networking&amp;action=history"/>
	<updated>2026-05-03T23:02:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://aznot.com/index.php?title=Linux/Networking&amp;diff=8218&amp;oldid=prev</id>
		<title>Kenneth: /* ifconfig */</title>
		<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Linux/Networking&amp;diff=8218&amp;oldid=prev"/>
		<updated>2024-12-21T03:46:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;ifconfig&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 03:46, 21 December 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l272&quot;&gt;Line 272:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 272:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To set an IP address for a device:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To set an IP address for a device:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ifconfig eth0 10.10.10.1 netmask 255.255.255.0&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ifconfig eth0 10.10.10.1 netmask 255.255.255.0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; ifconfig eth0 10.10.10.1/24&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To bring up / bring down a device:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To bring up / bring down a device:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key aznot:diff:1.41:old-4711:rev-8218:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Kenneth</name></author>
	</entry>
	<entry>
		<id>https://aznot.com/index.php?title=Linux/Networking&amp;diff=4711&amp;oldid=prev</id>
		<title>Kenneth: /* Secondary IP Address */</title>
		<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Linux/Networking&amp;diff=4711&amp;oldid=prev"/>
		<updated>2018-05-26T03:44:49Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Secondary IP Address&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== IP and Routing ==&lt;br /&gt;
&lt;br /&gt;
=== Interfaces ===&lt;br /&gt;
&lt;br /&gt;
List interfaces:&lt;br /&gt;
 ifconfig&lt;br /&gt;
 ifconfig -a&lt;br /&gt;
 ifconfig eth1&lt;br /&gt;
 ip a&lt;br /&gt;
 ip route addr show&lt;br /&gt;
 ip address show&lt;br /&gt;
 ip address show dev eth1&lt;br /&gt;
 ls /proc/sys/net/ipv4/conf/&lt;br /&gt;
 ls /sys/class/net/&lt;br /&gt;
&lt;br /&gt;
Bring interface up/down:&lt;br /&gt;
 ifconfig eth1 up&lt;br /&gt;
 ifconfig eth1 down&lt;br /&gt;
&lt;br /&gt;
To configure an interface:&lt;br /&gt;
 ifconfig [interface] [address] netmask [netmask]&lt;br /&gt;
 ifconfig eth1 10.10.11.15 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
 # Note: This will add the following to the routing table:&lt;br /&gt;
 Kernel IP routing table&lt;br /&gt;
 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface&lt;br /&gt;
 10.10.11.0      *               255.255.255.0   U     0      0        0 eth1&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 ifconfig eth0 up&lt;br /&gt;
 ifconfig eth0 10.10.10.5 netmask 255.255.255.0&lt;br /&gt;
 route add default gw 10.10.10.1&lt;br /&gt;
&lt;br /&gt;
=== Routes ===&lt;br /&gt;
&lt;br /&gt;
List routes:&lt;br /&gt;
 route&lt;br /&gt;
 route -n&lt;br /&gt;
 ip route&lt;br /&gt;
 ip route show&lt;br /&gt;
&lt;br /&gt;
=== Secondary IP Address ===&lt;br /&gt;
&lt;br /&gt;
 # ifconfig [nic]:0 [IP-Address] netmask [mask] up&lt;br /&gt;
 ifconfig eth0:0 192.168.1.2 netmask 255.255.255.0 up&lt;br /&gt;
&lt;br /&gt;
Ref: [https://www.garron.me/en/linux/add-secondary-ip-linux.html]&lt;br /&gt;
&lt;br /&gt;
=== ipcalc ===&lt;br /&gt;
&lt;br /&gt;
 $ ipcalc 10.20.30.55 255.255.255.0 -bnmp&lt;br /&gt;
 $ ipcalc 10.20.30.55/24 -bnmp&lt;br /&gt;
 NETMASK=255.255.255.0&lt;br /&gt;
 PREFIX=24&lt;br /&gt;
 BROADCAST=10.20.30.255&lt;br /&gt;
 NETWORK=10.20.30.0&lt;br /&gt;
&lt;br /&gt;
=== Default Gateway ===&lt;br /&gt;
&lt;br /&gt;
 route add default gw 10.10.11.1&lt;br /&gt;
&lt;br /&gt;
 # with ip route&lt;br /&gt;
 ip route add default via 10.10.11.1&lt;br /&gt;
&lt;br /&gt;
 # routing table:&lt;br /&gt;
 Kernel IP routing table&lt;br /&gt;
 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface&lt;br /&gt;
 10.10.11.0      0.0.0.0         255.255.255.0   U     0      0        0 eth1&lt;br /&gt;
 0.0.0.0         10.10.11.1      0.0.0.0         UG    0      0        0 eth0&lt;br /&gt;
&lt;br /&gt;
/etc/sysconfig/network-scripts/ifup-eth:&lt;br /&gt;
 169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0&lt;br /&gt;
 test 169.254.0.0/16 (APIPA / DHCP link local)&lt;br /&gt;
&lt;br /&gt;
=== Static Network Route ===&lt;br /&gt;
&lt;br /&gt;
 route add -net [network] netmask [netmask] dev [iface]&lt;br /&gt;
 route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0&lt;br /&gt;
&lt;br /&gt;
 route add -net [network]/[cidr] dev [iface]&lt;br /&gt;
 route add -net 192.56.76.0/24 dev eth0&lt;br /&gt;
&lt;br /&gt;
 # delete is same format as &amp;#039;add&amp;#039;, but with &amp;#039;del&amp;#039; keyword.&lt;br /&gt;
 route del -net 192.56.76.0 netmask 255.255.255.0 dev eth0&lt;br /&gt;
&lt;br /&gt;
 route add -net [network] netmask [netmask] gw [gw-address]&lt;br /&gt;
 route add -net 192.57.66.0 netmask 255.255.255.0 gw 10.10.11.1&lt;br /&gt;
&lt;br /&gt;
 route add -net [network] netmask [netmask] gw [gw-address] dev [iface]&lt;br /&gt;
 route add -net 192.57.66.0 netmask 255.255.255.0 gw 10.10.11.1 dev eth1&lt;br /&gt;
&lt;br /&gt;
 # Using ip route:&lt;br /&gt;
 ip route add [network]/[cidr] via [gw-address]&lt;br /&gt;
 ip route add 172.16.0.0/24 via 192.168.0.3&lt;br /&gt;
&lt;br /&gt;
 # startup&lt;br /&gt;
 echo &amp;quot;ip route add 172.16.0.0/24 via 192.168.0.3&amp;quot; &amp;gt;&amp;gt; /etc/rc.local&lt;br /&gt;
&lt;br /&gt;
=== Static Host Route ===&lt;br /&gt;
&lt;br /&gt;
 route add -host [host] dev [iface]&lt;br /&gt;
 route add -host 10.10.10.31 dev eth1&lt;br /&gt;
&lt;br /&gt;
 route add -host [host] gw [gw-address]&lt;br /&gt;
 route add -host 192.168.98.42 gw 192.168.99.1&lt;br /&gt;
&lt;br /&gt;
Note: use &amp;#039;arp -a&amp;#039; to verify source address&lt;br /&gt;
&lt;br /&gt;
=== DHCP ===&lt;br /&gt;
&lt;br /&gt;
 dhclient eth0      # get dhcp address&lt;br /&gt;
 dhclient -r eth0   # release address&lt;br /&gt;
&lt;br /&gt;
Server Lease information: (including DHCP server) [http://www.cyberciti.biz/faq/linux-find-out-dhcp-server-ip-address/]&lt;br /&gt;
 /var/lib/dhcp/dhclient.leases&lt;br /&gt;
   option dhcp-server-identifier 192.168.1.1;&lt;br /&gt;
&lt;br /&gt;
Client side lease information: (DHCP server is &amp;#039;option dhcp-server-identifier&amp;#039;)&lt;br /&gt;
 /var/lib/dhclient/dhclient.leases&lt;br /&gt;
&lt;br /&gt;
How do I find out my DHCP server address - http://www.cyberciti.biz/faq/linux-find-out-dhcp-server-ip-address/&lt;br /&gt;
&lt;br /&gt;
== DNS ==&lt;br /&gt;
&lt;br /&gt;
See [[Linux/DNS]]&lt;br /&gt;
&lt;br /&gt;
== Network Monitoring ==&lt;br /&gt;
&lt;br /&gt;
20 Linux System Monitoring Tools Every SysAdmin Should Know - http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html&lt;br /&gt;
: netstat and ss - Network Statistics&lt;br /&gt;
: iptraf - Real-time Network Statistics&lt;br /&gt;
: tcpdump - Detailed Network Traffic Analysis&lt;br /&gt;
: nmap - scan your server for open ports.&lt;br /&gt;
: ntop web based tool - ntop is the best tool to see network usage in a way similar to what top command does for processes i.e. it is network traffic monitoring software. You can see network status, protocol wise distribution of traffic for UDP, TCP, DNS, HTTP and other protocols.&lt;br /&gt;
: vnstat - vnStat is a console-based network traffic monitor. It keeps a log of hourly, daily and monthly network traffic for the selected interface(s).&lt;br /&gt;
: mtr - mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool.&lt;br /&gt;
&lt;br /&gt;
== IP Forwarding ==&lt;br /&gt;
&lt;br /&gt;
=== Check if IP Forwarding is enabled ===&lt;br /&gt;
&lt;br /&gt;
We have to query the sysctl kernel value net.ipv4.ip_forward to see if forwarding is enabled or not:&lt;br /&gt;
&lt;br /&gt;
Using sysctl:&lt;br /&gt;
&lt;br /&gt;
 sysctl net.ipv4.ip_forward&lt;br /&gt;
 net.ipv4.ip_forward = 0&lt;br /&gt;
&lt;br /&gt;
or just checking out the value in the /proc system:&lt;br /&gt;
&lt;br /&gt;
 cat /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
 0&lt;br /&gt;
&lt;br /&gt;
As we can see in both the above examples this was disabled (as show by the value 0).&lt;br /&gt;
&lt;br /&gt;
=== Enable IP Forwarding on the fly ===&lt;br /&gt;
&lt;br /&gt;
As with any sysctl kernel parameters we can change the value of net.ipv4.ip_forward on the fly (without rebooting the system):&lt;br /&gt;
&lt;br /&gt;
 sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&lt;br /&gt;
the setting is changed instantly; the result will not be preserved after rebooting the system.&lt;br /&gt;
&lt;br /&gt;
=== Permanent setting ===&lt;br /&gt;
&lt;br /&gt;
Permanent setting using /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
If we want to make this configuration permanent the best way to do it is using the file /etc/sysctl.conf where we can add a line containing net.ipv4.ip_forward = 1&lt;br /&gt;
&lt;br /&gt;
 /etc/sysctl.conf:&lt;br /&gt;
 net.ipv4.ip_forward = 1&lt;br /&gt;
&lt;br /&gt;
if you already have an entry net.ipv4.ip_forward with the value 0 you can change that 1.&lt;br /&gt;
&lt;br /&gt;
To enable the changes made in sysctl.conf you will need to run the command:&lt;br /&gt;
&lt;br /&gt;
 sysctl -p /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
On RedHat based systems this is also enabled when restarting the network service:&lt;br /&gt;
&lt;br /&gt;
 service network restart&lt;br /&gt;
&lt;br /&gt;
and on Debian/Ubuntu systems this can be also done restarting the procps service:&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/procps.sh restart&lt;br /&gt;
&lt;br /&gt;
Source: [http://www.ducea.com/2006/08/01/how-to-enable-ip-forwarding-in-linux/ How to enable IP Forwarding in Linux | MDLog:/sysadmin]&lt;br /&gt;
&lt;br /&gt;
== SSH Tunneling ==&lt;br /&gt;
&lt;br /&gt;
[http://www.ssh.com/support/documentation/online/ssh/adminguide/32/Port_Forwarding.html Port Forwarding]&lt;br /&gt;
&lt;br /&gt;
Local port forwarding:&lt;br /&gt;
&lt;br /&gt;
 ssh -L 1234:localhost:23 username@host&lt;br /&gt;
&lt;br /&gt;
All traffic coming to port 1234 on the client will be forwarded to port 23 on the server (host). Note that localhost will be resolved by the sshdserver after the connection is established. In this case localhost therefore refers to the server (host) itself.&lt;br /&gt;
&lt;br /&gt;
Remote port forwarding:&lt;br /&gt;
&lt;br /&gt;
 ssh2 -R 1234:localhost:23 username@host&lt;br /&gt;
&lt;br /&gt;
All traffic which comes to port 1234 on the server (host) will be forwarded to port 23 on the client (localhost).&lt;br /&gt;
&lt;br /&gt;
== Port Forwarding using Iptables ==&lt;br /&gt;
&lt;br /&gt;
 iptables -t nat -A PREROUTING -p tcp -i eth0 -d 10.161.101.40 --dport 3306 -j DNAT --to 10.20.30.48:3306&lt;br /&gt;
 iptables -A FORWARD -p tcp -i eth0 -d 10.20.30.48 --dport 3306 -j ACCEPT&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&lt;br /&gt;
==Firewall Topologies==&lt;br /&gt;
&lt;br /&gt;
*[http://searchwebservices.techtarget.com/sDefinition/0,,sid26_gci213891,00.html DMZ definition]&lt;br /&gt;
*[http://searchsecurity.techtarget.com/tip/0,289483,sid14_gci906407,00.html Firewall Topologies]&lt;br /&gt;
*[http://searchsecurity.techtarget.com/digitalguide/images/Misc/bastion_host.gif Bastion host]&lt;br /&gt;
*[http://searchsecurity.techtarget.com/digitalguide/images/Misc/screened_subnet.gif Screened subnet]&lt;br /&gt;
*[http://searchsecurity.techtarget.com/digitalguide/images/Misc/two_firewalls.gif Dual firewalls]&lt;br /&gt;
&lt;br /&gt;
==Address Translation==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Port_address_translation Wiki: PAT]&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Network_address_translation Wiki: NAT]&lt;br /&gt;
&lt;br /&gt;
== Red Hat Static Routes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/etc/sysconfig/network-scripts/route-&amp;lt;interface-name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Contains lines that specify additional routes that should be added when the&lt;br /&gt;
  associated interface is brought up.&lt;br /&gt;
&lt;br /&gt;
  The files are processed by the ifup-routes script and uses the /sbin/ipcalc&lt;br /&gt;
  utility for all network masks and numbers. Routes are specified using the&lt;br /&gt;
  syntax:&lt;br /&gt;
&lt;br /&gt;
    ADDRESSn=&amp;lt;network&amp;gt;&lt;br /&gt;
    NETMASKn=&amp;lt;network/prefix mask&amp;gt;&lt;br /&gt;
    GATEWAYn=&amp;lt;next-hop router/gateway IP address&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  The &amp;quot;n&amp;quot; can be any integer number, but is expected to be monotonically&lt;br /&gt;
  increasing and counting starts from 0. For example:&lt;br /&gt;
&lt;br /&gt;
    ADDRESS0=192.168.2.0&lt;br /&gt;
    NETMASK0=255.255.255.0&lt;br /&gt;
    GATEWAY0=192.168.1.1&lt;br /&gt;
&lt;br /&gt;
  adds a network route to the 192.168.2.0 network via the gateway at&lt;br /&gt;
  192.168.1.1. Since you must already have a route to the network of the&lt;br /&gt;
  gateway, there is no need to specify a device.&lt;br /&gt;
&lt;br /&gt;
  Note: The ifup-routes script also supports an older syntax designed to be&lt;br /&gt;
  used directly as an argument to &amp;quot;/sbin/ip route add&amp;quot;. This syntax is&lt;br /&gt;
  deprecated, but if no &amp;quot;ADDRESSn&amp;quot; lines are found the following will still&lt;br /&gt;
  work:&lt;br /&gt;
&lt;br /&gt;
  192.168.2.0/24 dev ppp0&lt;br /&gt;
&lt;br /&gt;
  adds a network route to the 192.168.2.0 network through ppp0.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Source: /usr/share/doc/initscripts-8.45.30/sysconfig.txt&lt;br /&gt;
&lt;br /&gt;
== Networking ==&lt;br /&gt;
&lt;br /&gt;
===ifconfig===&lt;br /&gt;
&lt;br /&gt;
To set an IP address for a device:&lt;br /&gt;
 ifconfig eth0 10.10.10.1 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
To bring up / bring down a device:&lt;br /&gt;
 ifconfig eth0 up&lt;br /&gt;
 ifconfig eth0 down&lt;br /&gt;
&lt;br /&gt;
To create a virtual IP address:&lt;br /&gt;
 ifconfig eth0:1 10.10.20.1 netmask 255.255.255.0&lt;br /&gt;
 &lt;br /&gt;
====counter reset====&lt;br /&gt;
&lt;br /&gt;
The TX/RX bytes reset at 4GB&lt;br /&gt;
&lt;br /&gt;
[http://lists.us.dell.com/pipermail/linux-poweredge/2002-April/002461.html Bytes counter of ifconfig in 7.2 resets?]:&lt;br /&gt;
:&amp;quot;the values are stored as unsigned 32-bit integers, in which case the maximum value which can be stored is 4,294,967,295 (2^32 - 1)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This means that one can not track the usage of the system over much time.&lt;br /&gt;
&lt;br /&gt;
The [http://www.ducea.com/2006/09/08/resetting-ifconfig-counters/ ifconfig counters can be forcefully reset] by unloading/reloading the module.&lt;br /&gt;
&lt;br /&gt;
===route===&lt;br /&gt;
&lt;br /&gt;
To add a static route:&lt;br /&gt;
 route add -net 10.10.30.1 netmask 255.255.255.0 gw 10.10.10.1&lt;br /&gt;
 route add -net 10.10.30.1 netmask 255.255.255.0 dev eth0&lt;br /&gt;
 route add -net 10.10.30.1 netmask 255.255.255.0 eth0&lt;br /&gt;
&lt;br /&gt;
To add a default gateway:&lt;br /&gt;
 route add default gw 10.10.10.1&lt;br /&gt;
&lt;br /&gt;
== mtr ==&lt;br /&gt;
&lt;br /&gt;
My Traceroute&lt;br /&gt;
&lt;br /&gt;
MTR - http://www.bitwizard.nl/mtr/&lt;br /&gt;
&lt;br /&gt;
&amp;quot;mtr combines the functionality of the &amp;#039;traceroute&amp;#039; and &amp;#039;ping&amp;#039; programs in a single network diagnostic tool.&lt;br /&gt;
&lt;br /&gt;
As mtr starts, it investigates the network connection between the host mtr runs on and a user-specified destination host. After it determines the address of each network hop between the machines, it sends a sequence ICMP ECHO requests to each one to determine the quality of the link to each machine. As it does this, it prints running statistics about each machine.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Sample:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                                    My traceroute  [v0.80]&lt;br /&gt;
oeey.com.com (0.0.0.0)                                               Sat Nov  6 23:04:45 2010&lt;br /&gt;
Keys:  Help   Display mode   Restart statistics   Order of fields   quit&lt;br /&gt;
                                                     Packets               Pings&lt;br /&gt;
 Host                                              Loss%   Snt   Last   Avg  Best  Wrst StDev&lt;br /&gt;
 1. xxxx                                            0.0%   112    0.3   0.3   0.3   0.5   0.0&lt;br /&gt;
 2. xxxx                                            0.0%   112    0.4   0.4   0.4   0.5   0.0&lt;br /&gt;
 3. ip65-44-63-65.z63-46-65.customer.algx.net       0.0%   112    1.5   3.2   1.4  79.5  10.5&lt;br /&gt;
 4. vb1611.rar3.sanjose-ca.us.xo.net                0.0%   112   18.3  18.1  17.6  19.4   0.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
From yum:&lt;br /&gt;
 yum install mtr&lt;br /&gt;
&lt;br /&gt;
Source:&lt;br /&gt;
 # if you want the TUI:&lt;br /&gt;
 yum install ncurses-devel&lt;br /&gt;
 &lt;br /&gt;
 VER=0.80&lt;br /&gt;
 cd ~/src&lt;br /&gt;
 wget ftp://ftp.bitwizard.nl/mtr/mtr-$VER.tar.gz&lt;br /&gt;
 tar -zvxf mtr-$VER.tar.gz&lt;br /&gt;
 cd mtr-$VER&lt;br /&gt;
 ./configure --prefix=/opt/mtr&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
Execute:&lt;br /&gt;
 mtr [HOST]&lt;br /&gt;
 /opt/mtr/sbin/mtr [HOST]&lt;br /&gt;
&lt;br /&gt;
== ip and iproute ==&lt;br /&gt;
&lt;br /&gt;
The iproute2 package is designed to be a replacement for the standard networking toolset (ie. ifconfig, route, etc)&lt;br /&gt;
&lt;br /&gt;
iproute2 - Advanced IP routing and network device configuration tools.&lt;br /&gt;
:The iproute package contains networking utilities (ip and rtmon, for&lt;br /&gt;
:example) which are designed to use the advanced networking&lt;br /&gt;
:capabilities of the Linux 2.4.x and 2.6.x kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ip link list&lt;br /&gt;
&lt;br /&gt;
1: lo:  mtu 16436 qdisc noqueue &lt;br /&gt;
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00&lt;br /&gt;
2: eth0:  mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
    link/ether 00:06:5b:8d:13:a0 brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ip address show&lt;br /&gt;
&lt;br /&gt;
1: lo:  mtu 16436 qdisc noqueue &lt;br /&gt;
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00&lt;br /&gt;
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo&lt;br /&gt;
    inet6 ::1/128 scope host &lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
2: eth0:  mtu 1500 qdisc pfifo_fast qlen 1000&lt;br /&gt;
    link/ether 00:06:5b:8d:13:a0 brd ff:ff:ff:ff:ff:ff&lt;br /&gt;
    inet 200.3.128.12/24 brd 216.3.128.255 scope global eth0&lt;br /&gt;
    inet6 fe80::206:5bff:fe8d:13a0/64 scope link &lt;br /&gt;
       valid_lft forever preferred_lft forever&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ip route show&lt;br /&gt;
&lt;br /&gt;
200.3.128.0/24 dev eth0  proto kernel  scope link  src &lt;br /&gt;
200.3.128.12 default via 216.3.128.1 dev eth0 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== NIC Bonding ==&lt;br /&gt;
&lt;br /&gt;
Also known as teaming, ether channel, or maybe trunking.&lt;br /&gt;
&lt;br /&gt;
See [[Linux/Network Bonding]]&lt;br /&gt;
&lt;br /&gt;
== kping - History Ping ==&lt;br /&gt;
&lt;br /&gt;
See [[kping]]&lt;br /&gt;
&lt;br /&gt;
== pinglog ==&lt;br /&gt;
&lt;br /&gt;
See [[pinglog]]&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
http://www.felipecruz.com/blog_change-gateway-linux-unix.php&lt;br /&gt;
&lt;br /&gt;
route add default gw 192.168.1.1 wlan0&lt;br /&gt;
&lt;br /&gt;
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch14_:_Linux_Firewalls_Using_iptables&lt;br /&gt;
&lt;br /&gt;
http://www.yolinux.com/TUTORIALS/LinuxTutorialIptablesNetworkGateway.html&lt;br /&gt;
&lt;br /&gt;
http://www.linuxforums.org/forum/linux-networking/36934-port-forwarding-iptables.html&lt;br /&gt;
&lt;br /&gt;
http://www.hackorama.com/network/portfwd.shtml&lt;br /&gt;
&lt;br /&gt;
== Determining Network Driver ==&lt;br /&gt;
&lt;br /&gt;
Linux: Find out Ethernet card driver name - http://www.cyberciti.biz/faq/linux-find-out-what-driver-my-ethernet-card-is-using/&lt;br /&gt;
&lt;br /&gt;
What was installed:&lt;br /&gt;
 grep eth0 /etc/modprobe.conf&lt;br /&gt;
&lt;br /&gt;
What is currently in use:&lt;br /&gt;
 ethtool -i eth0&lt;br /&gt;
&lt;br /&gt;
Show module information:&lt;br /&gt;
 modinfo [MODULE]&lt;br /&gt;
&lt;br /&gt;
Linux: Find Wireless Driver Chipset Information - http://www.cyberciti.biz/faq/linux-find-wireless-driver-chipset/&lt;br /&gt;
&lt;br /&gt;
 lspci -vv -s [ID] | grep driver  # doesn&amp;#039;t always work!&lt;br /&gt;
   Kernel driver in use: iwlagn&lt;br /&gt;
&lt;br /&gt;
Show vendor/device ID:&lt;br /&gt;
 lspci -n -s [ID]&lt;br /&gt;
&lt;br /&gt;
Show name and vendor/device ID:  # doesn&amp;#039;t always work&lt;br /&gt;
 lspci -nn -s [ID]&lt;br /&gt;
&lt;br /&gt;
== keywords ==&lt;br /&gt;
&lt;br /&gt;
linux networking&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Network Admin]]&lt;/div&gt;</summary>
		<author><name>Kenneth</name></author>
	</entry>
</feed>