Altera_Forum
Honored Contributor
20 years agoHow to deal with the route in Linux
the next figure is my network
----<--Extern Network(ADSL module)(IP base : 192.168.1.1 netmask 255.255.255.0 --> | | |______><Route (IP base 192.168.2.1 netmask 255.255.255.0)>--> ___><my PC IP : 192.168.2.102 netmask 255.255.255.0> | |_><my EP2C35 Board> NOW, I have install a FTP seriver in my Pc. I want to transfer a file from the pc to my board (ep2c35 dev kit) so first i config the IP <div class='quotetop'>QUOTE </div> --- Quote Start --- # ifconfig eth0 192.168.2.12 eth0 eth0:PHY 100BaseT eth0:PHY Full Duplex[/b] --- Quote End --- ok I find it can't connect when I ping my PC so i check the information of route. <div class='quotetop'>QUOTE </div> --- Quote Start --- # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.2.0 * 255.255.255.0 U 0 0 0 eth0 127.0.0.0 * 255.0.0.0 U 0 0 0 lo I don't konw how to change the IP(192.168.2.0) of eth0 to 192.168.2.1) so i had to add a route .but i got a errors . # route add 192.168.1.1 gw 192.168.2.1 netmask 255.255.255.0 eth0 route: netmask 000000ff and host route conflict# [/b] --- Quote End --- if i don't care the netmask . the netmask will become to "255.255.255.255". <div class='quotetop'>QUOTE </div> --- Quote Start --- # route add 192.168.1.1 gw 192.168.2.1 eth0# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.1 192.168.2.1 255.255.255.255 UGH 0 0 0 eth0 192.168.2.0 * 255.255.255.0 U 0 0 0 eth0 127.0.0.0 * 255.0.0.0 U 0 0 0 lo# [/b] --- Quote End --- can you tell me ! how to deal with it . thanks !