0
1. View Network Settings of an Ethernet Adapter

# ifconfig eth0

2. Display Details of All interfaces Including Disabled Interfaces

# ifconfig -a

3. Disable an Interface

# ifconfig eth0 down

4. Enable an Interface

# ifconfig eth0 up

5. Assign ip-address to an Interface

# ifconfig eth0 192.160.2.15

6. Change Subnet mask of the interface eth0.

# ifconfig eth0 netmask 255.255.255.0

7. Change Broadcast address of the interface eth0.

# ifconfig eth0 broadcast 192.168.2.255

8. Assign ip-address, netmask and broadcast at the same time to interface eht0.

# ifconfig eth0 192.168.2.2 netmask 255.255.255.0 broadcast 192.168.2.255

9. Change MTU


# ifconfig eth0 mtu XX

10. Promiscuous mode


Following will put the interface in promiscuous mode.
# ifconfig eth0 promisc

Following will put the interface in normal mode
# ifconfig eth0 -promisc


11. Display Existing Routes

$ route

$ route -n

12. Adding a Default Gateway

$ route add default gw 192.168.1.10

$ ping www.google.com

13. List Kernel’s Routing Cache Information

$ route -Cn

14. Reject Routing to a Particular Host or Network

$ route add -host 192.168.1.51 reject

$ ping 192.168.1.51

reject an entire network

$ route add -net 192.168.1.0 netmask 255.255.255.0 reject

15. Make 192.168.3.* Accessible from 192.168.1.*

$ route add default gw 192.168.1.10

$ route add -net 192.168.3.0 netmask 255.255.255.0 gw 192.168.3.10

16. Make 192.168.1.* Accessible from 192.168.3.*

$ route add default gw 192.168.3.10

$ route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.10

17. Allow Internet Access ( External World )

$ route add default gw 125.250.60.59

Post a Comment

 
Top