loadYOURSELF

loadYOURSELF

Browsing Posts tagged ifconfig

Needed program:
Iptables

PC 1

system gateway = 192.168.2.1 (eth1)

Eth1: (connected to internet with configuration) 192.168.2.2 netmask 255.255.255.0

Eth0: (other PC connected to this port) 192.168.1.1 netmask 255.255.255.0  (with cross cable maybe)

other PC configuration : 192.168.1.2 netmask 255.255.255.0 gateway 192.168.1.1 dns 192.168.1.1

If system is configured to start with defined script below then second PC can be access to internet if it’s network address equals to 192.168.1.x and gateway is 192.168.1.1 and dns is 192.168.1.1

Assign new ip =   ifconfig eth0 192.168.1.10

Assign IP/Subnet =  ifconfig eth0 192.168.1.10 netmask 255.255.255.0

Assign Default Gateway=  route add default gw 192.168.1.1

Assign multiple IP’s =  ifconfig eth0:0 192.168.1.10 netmask 255.255.255.0

Assign second IP =  ifconfig eth0:1 10.1.10.20 netmask 255.255.0.0

Buy me a beer